Skip to content

Commit

Permalink
Merge branch 'PHP-5.6'
Browse files Browse the repository at this point in the history
* PHP-5.6:
  Fix potential segfault in dns_get_record()
  • Loading branch information
sgolemon committed Jun 11, 2014
2 parents ec974c4 + e2ef56f commit b34d784
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ext/standard/dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b34d784

Please sign in to comment.