1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

ftp: UBsan fixup 'pointer index expression overflowed'

Closes #1939
This commit is contained in:
Daniel Stenberg 2017-10-03 17:20:06 +02:00
parent 031c367531
commit a69a4d222d
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -2419,8 +2419,8 @@ static CURLcode ftp_state_get_resp(struct connectdata *conn,
char *bytes; char *bytes;
char *buf = data->state.buffer; char *buf = data->state.buffer;
bytes = strstr(buf, " bytes"); bytes = strstr(buf, " bytes");
if(bytes--) { if(bytes) {
long in = (long)(bytes-buf); long in = (long)(--bytes-buf);
/* this is a hint there is size information in there! ;-) */ /* this is a hint there is size information in there! ;-) */
while(--in) { while(--in) {
/* scan for the left parenthesis and break there */ /* scan for the left parenthesis and break there */