mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: Fix potential segfault in dns_get_record()
This commit is contained in:
commit
1978f41c8a
@ -517,6 +517,10 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
|
||||
|
||||
while (ll < dlen) {
|
||||
n = cp[ll];
|
||||
if ((ll + n) >= dlen) {
|
||||
// Invalid chunk length, truncate
|
||||
n = dlen - (ll + 1);
|
||||
}
|
||||
memcpy(tp + ll , cp + ll + 1, n);
|
||||
add_next_index_stringl(entries, cp + ll + 1, n, 1);
|
||||
ll = ll + n + 1;
|
||||
|
Loading…
Reference in New Issue
Block a user