aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-nfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-nfs.c')
-rw-r--r--epan/dissectors/packet-nfs.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c
index 0a821953d3..16e990f949 100644
--- a/epan/dissectors/packet-nfs.c
+++ b/epan/dissectors/packet-nfs.c
@@ -39,6 +39,7 @@
#include <epan/prefs.h>
#include <epan/packet.h>
#include <epan/emem.h>
+#include <epan/strutil.h>
static int proto_nfs = -1;
@@ -1317,10 +1318,11 @@ dissect_fhandle_data_NETAPP(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *t
flag_string=ep_alloc(512);
flag_string[0]=0;
- while (bit--)
- if (flags & (1<<bit))
- strncat(flag_string, strings[bit], 512 - strlen(flag_string));
- flag_string[512-1] = '\0';
+ while (bit--) {
+ if (flags & (1<<bit)) {
+ g_strlcat(flag_string, strings[bit], 512);
+ }
+ }
item = proto_tree_add_text(tree, tvb, offset + 0, 8,
"mount (inode %u)", mount);
subtree = proto_item_add_subtree(item, ett_nfs_fh_mount);
@@ -1439,10 +1441,9 @@ dissect_fhandle_data_NETAPP_V4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree
while (bit--) {
if (flags & (1<<bit)) {
- strncat(flag_string, strings[bit], 512 - strlen(flag_string));
+ g_strlcat(flag_string, strings[bit], 512);
}
}
- flag_string[512-1] = '\0';
item = proto_tree_add_text(tree, tvb, offset + 0, 8, "export (inode %u)", fileid);
subtree = proto_item_add_subtree(item, ett_nfsv4_fh_export);