Commit:    18fdab5a09b64252a9a61ad6d1b2eff4a257b8f2
Author:    Stanislav Malyshev <s...@php.net>         Tue, 23 Apr 2013 21:42:15 
-0700
Parents:   4cf0647399b7f79fa1d74bba9d528bc74b78ba10
Branches:  PHP-5.3 PHP-5.4 PHP-5.5 master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=18fdab5a09b64252a9a61ad6d1b2eff4a257b8f2

Log:
Fix bug #64458 (dns_get_record result with string of length -1)

Bugs:
https://bugs.php.net/64458

Changed paths:
  M  NEWS
  M  ext/standard/dns.c


Diff:
diff --git a/NEWS b/NEWS
index 0876c1e..af4957e 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 7bf7cca..8e24a81 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;


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to