aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ftp.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-ftp.c')
-rw-r--r--epan/dissectors/packet-ftp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/epan/dissectors/packet-ftp.c b/epan/dissectors/packet-ftp.c
index 2bdf5bdbe8..2557457dc0 100644
--- a/epan/dissectors/packet-ftp.c
+++ b/epan/dissectors/packet-ftp.c
@@ -327,6 +327,11 @@ parse_eprt_request(const guchar* line, gint linelen, guint32 *eprt_af,
/* Copy the rest of the line into a null-terminated buffer. */
args = wmem_strndup(wmem_packet_scope(), line, linelen);
p = args;
+ /*
+ * Handle a NUL being in the line; if there's a NUL in the line,
+ * strlen(args) will terminate at the NUL and will thus return
+ * a value less than linelen.
+ */
if ((gint)strlen(args) < linelen)
linelen = (gint)strlen(args);