mirror of
https://github.com/mirror/wget.git
synced 2025-02-05 09:10:12 +08:00
Fix corner case in processing server response
* src/http.c (response_head_terminator): Don't access uninitialized data * fuzz/wget_read_hunk_fuzzer.c: Sync response_head_terminator()
This commit is contained in:
parent
4046cd2a71
commit
5d87635c66
@ -170,7 +170,7 @@ response_head_terminator (const char *start, const char *peeked, int peeklen)
|
||||
return p + 2;
|
||||
}
|
||||
/* p==end-2: check for \n\n directly preceding END. */
|
||||
if (p[0] == '\n' && p[1] == '\n')
|
||||
if (peeklen >= 2 && p[0] == '\n' && p[1] == '\n')
|
||||
return p + 2;
|
||||
|
||||
return NULL;
|
||||
|
@ -553,7 +553,7 @@ response_head_terminator (const char *start, const char *peeked, int peeklen)
|
||||
return p + 2;
|
||||
}
|
||||
/* p==end-2: check for \n\n directly preceding END. */
|
||||
if (p[0] == '\n' && p[1] == '\n')
|
||||
if (peeklen >= 2 && p[0] == '\n' && p[1] == '\n')
|
||||
return p + 2;
|
||||
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user