]> granicus.if.org Git - php/commitdiff
Backport of http://news.php.net/php.cvs/60381 to PHP 5_2 which fixes a potential...
authorUlf Wendel <uw@php.net>
Mon, 14 Sep 2009 16:51:11 +0000 (16:51 +0000)
committerUlf Wendel <uw@php.net>
Mon, 14 Sep 2009 16:51:11 +0000 (16:51 +0000)
ext/mysqli/mysqli_api.c
ext/mysqli/php_mysqli.h

index 7cd6f32ddc7cceb8effa99b89e0133c4c39d6111..039a771f91b6362a52634582e0f7c6a6aef9dbc9 100644 (file)
@@ -364,7 +364,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
                                bind[ofs].buffer = stmt->result.buf[ofs].val;
                                bind[ofs].is_null = &stmt->result.is_null[ofs];
                                bind[ofs].buffer_length = stmt->result.buf[ofs].buflen;
-                               bind[ofs].length = &stmt->result.buf[ofs].buflen;
+                               bind[ofs].length = &stmt->result.buf[ofs].output_len;
                                break;
                        }
                        default:
@@ -735,7 +735,7 @@ PHP_FUNCTION(mysqli_stmt_fetch)
 #else
                                                        {
 #endif
-                                                               ZVAL_STRINGL(stmt->result.vars[i], stmt->result.buf[i].val, stmt->result.buf[i].buflen, 1);
+                                                               ZVAL_STRINGL(stmt->result.vars[i], stmt->result.buf[i].val, stmt->result.buf[i].output_len, 1);
                                                        }
                                                }
                                                break;
index 04bdc017a8dd23f29237935d868cc9ac8748a3ac..d874703190615e501e77d41656a31e13375cb26e 100644 (file)
@@ -52,8 +52,9 @@ enum mysqli_status {
 };
 
 typedef struct {
+        char            *val;
        ulong           buflen;
-       char            *val;
+        ulong           output_len;
        ulong           type;
 } VAR_BUFFER;