summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2013-04-23 21:42:15 -0700
committerStanislav Malyshev <stas@php.net>2013-04-23 21:43:35 -0700
commit18fdab5a09b64252a9a61ad6d1b2eff4a257b8f2 (patch)
tree170773479457ab446d76fc501f7a8c12680eaafd
parent4cf0647399b7f79fa1d74bba9d528bc74b78ba10 (diff)
downloadphp-git-18fdab5a09b64252a9a61ad6d1b2eff4a257b8f2.tar.gz
Fix bug #64458 (dns_get_record result with string of length -1)
-rw-r--r--NEWS1
-rw-r--r--ext/standard/dns.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 0876c1e2fe..af4957e365 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ PHP NEWS
- Core:
. Fixed bug #64578 (debug_backtrace in set_error_handler corrupts zend heap:
segfault). (Laruence)
+ . Fixed bug #64458 (dns_get_record result with string of length -1). (Stas)
. Fixed bugs #47675 and #64577 (fd leak on Solaris)
- Zip:
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index 7bf7ccac85..8e24a817ff 100644
--- a/ext/standard/dns.c
+++ b/ext/standard/dns.c
@@ -514,7 +514,7 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
tp[dlen] = '\0';
cp += dlen;
- add_assoc_stringl(*subarray, "txt", tp, dlen - 1, 0);
+ add_assoc_stringl(*subarray, "txt", tp, (dlen>0)?dlen - 1:0, 0);
add_assoc_zval(*subarray, "entries", entries);
}
break;