diff options
author | Daniel Stenberg <daniel@haxx.se> | 2017-10-03 17:20:06 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-10-03 17:20:06 +0200 |
commit | 20766dab6e1091c163c10b08eb1c0fa5e668ba69 (patch) | |
tree | 63db2955ca9828ae0e78687fb3bc15fe9eb5422d /lib/ftp.c | |
parent | ff6774ea6a03ae193f92e7175e9b96aaffb3f44c (diff) | |
download | curl-bagder/ftp-pointer-overflow.tar.gz |
ftp: UBsan fixup 'pointer index expression overflowed'bagder/ftp-pointer-overflow
Diffstat (limited to 'lib/ftp.c')
-rw-r--r-- | lib/ftp.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 */ |