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-03 17:20:06 +0200
commit20766dab6e1091c163c10b08eb1c0fa5e668ba69 (patch)
tree63db2955ca9828ae0e78687fb3bc15fe9eb5422d
parentff6774ea6a03ae193f92e7175e9b96aaffb3f44c (diff)
downloadcurl-bagder/ftp-pointer-overflow.tar.gz
ftp: UBsan fixup 'pointer index expression overflowed'bagder/ftp-pointer-overflow
-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 */