mirror of
https://github.com/php/php-src.git
synced 2024-12-21 07:51:23 +08:00
Fix another pointer indexing UB in http_fopen_wrapper
Only compute the gep after checking whether the pointer is NULL.
This commit is contained in:
parent
11f3e24190
commit
1ce830a4aa
@ -91,9 +91,9 @@ static inline void strip_header(char *header_bag, char *lc_header_bag,
|
||||
) {
|
||||
char *header_start = header_bag + (lc_header_start - lc_header_bag);
|
||||
char *lc_eol = strchr(lc_header_start, '\n');
|
||||
char *eol = header_start + (lc_eol - lc_header_start);
|
||||
|
||||
if (lc_eol) {
|
||||
char *eol = header_start + (lc_eol - lc_header_start);
|
||||
size_t eollen = strlen(lc_eol);
|
||||
|
||||
memmove(lc_header_start, lc_eol+1, eollen);
|
||||
|
Loading…
Reference in New Issue
Block a user