aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ftp.c
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2014-09-30 21:07:26 +0200
committerMartin Kaiser <wireshark@kaiser.cx>2014-09-30 21:13:14 +0000
commit514c101cb1a8ef901c7f32b46d8c1a2aff3ed50f (patch)
treeda192008fa1722efe36ecbd4dc227e77b9ade494 /epan/dissectors/packet-ftp.c
parent9b181b97c62542625a5ea6573e68c85202dd1f38 (diff)
correct the line length if it was longer than the actual string supplied
by the caller Bug: 10516 Change-Id: Ib2c9ab449b95da92cc889d0992fad30f432a2836 Reviewed-on: https://code.wireshark.org/review/4386 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/dissectors/packet-ftp.c')
-rw-r--r--epan/dissectors/packet-ftp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/epan/dissectors/packet-ftp.c b/epan/dissectors/packet-ftp.c
index 6a4fa27b3b..2bdf5bdbe8 100644
--- a/epan/dissectors/packet-ftp.c
+++ b/epan/dissectors/packet-ftp.c
@@ -327,6 +327,8 @@ 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;
+ if ((gint)strlen(args) < linelen)
+ linelen = (gint)strlen(args);
/*
* RFC2428 sect. 2 states ...