Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  Fix potential segfault in dns_get_record()
This commit is contained in:
Sara Golemon 2014-06-11 13:37:40 -07:00
commit 1978f41c8a

View File

@ -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;