summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-10-03 17:20:06 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-10-04 14:47:09 +0200
commita69a4d222d661268e196d481a2a2b5c3c4cd6848 (patch)
treec24d895ae0418616273ab62d1dc70e6d9c08bfc6
parent031c3675315006932f63a1e195d1be7078b3e5fd (diff)
downloadcurl-a69a4d222d661268e196d481a2a2b5c3c4cd6848.tar.gz
ftp: UBsan fixup 'pointer index expression overflowed'
Closes #1939
-rw-r--r--lib/ftp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 54ba4057f..d7be88136 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -2419,8 +2419,8 @@ static CURLcode ftp_state_get_resp(struct connectdata *conn,
char *bytes;
char *buf = data->state.buffer;
bytes = strstr(buf, " bytes");
- if(bytes--) {
- long in = (long)(bytes-buf);
+ if(bytes) {
+ long in = (long)(--bytes-buf);
/* this is a hint there is size information in there! ;-) */
while(--in) {
/* scan for the left parenthesis and break there */