Commit:    25be12a3bcd4a56a094d28b73cdc5cee68970bf3
Author:    Xinchen Hui <larue...@php.net>         Wed, 18 Jul 2012 19:06:27 
+0800
Parents:   c7c939b5d8b2a8e2d7d72bf83c031005e93cd3fe
Branches:  PHP-5.4

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

Log:
Fixed bug #62594 (segfault in mysqlnd_res_meta::set_mode)

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

Changed paths:
  M  NEWS
  M  ext/mysqlnd/mysqlnd_debug.c


Diff:
diff --git a/NEWS b/NEWS
index 9da5717..280eb1f 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,9 @@ PHP                                                           
             NEWS
   . Fixed bug #62564 (Extending MessageFormatter and adding property causes 
     crash). (Felipe)
 
+- MySQLnd:
+  . Fixed bug #62594 (segfault in mysqlnd_res_meta::set_mode). (Laruence)
+
 - Reflection:
   . Implemented FR #61602 (Allow access to name of constant used as default 
     value). (reeze....@gmail.com)
diff --git a/ext/mysqlnd/mysqlnd_debug.c b/ext/mysqlnd/mysqlnd_debug.c
index 5c77b42..044a7d6 100644
--- a/ext/mysqlnd/mysqlnd_debug.c
+++ b/ext/mysqlnd/mysqlnd_debug.c
@@ -516,9 +516,11 @@ enum mysqlnd_debug_parser_state
 static void
 MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char * 
const mode)
 {
-       unsigned int mode_len = strlen(mode), i;
+       unsigned int mode_len, i;
        enum mysqlnd_debug_parser_state state = PARSER_WAIT_MODIFIER;
 
+       mode_len = mode? strlen(mode) : 0;
+
        self->flags = 0;
        self->nest_level_limit = 0;
        if (self->file_name && self->file_name != 
mysqlnd_debug_default_trace_file) {


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

Reply via email to