diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-09-30 14:31:45 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-09-30 21:32:59 +0000 |
commit | 0cc027cc267952e51e7b17e8e3cef51592f9e013 (patch) | |
tree | b09bcd100a19ab6c91fc5ac12716fd7c6c82b06a | |
parent | 514c101cb1a8ef901c7f32b46d8c1a2aff3ed50f (diff) |
Note why strlen(args) could be < linelen.
Change-Id: I8fb3c35be0aa80895b8a917af8a9fd2542fbd9d6
Reviewed-on: https://code.wireshark.org/review/4393
Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r-- | epan/dissectors/packet-ftp.c | 5 |
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); |