Re: cvs: php4 /ext/oci8 oci8.c

From: Date: Mon, 13 Nov 2000 17:43:49 +0000
Subject: Re: cvs: php4 /ext/oci8 oci8.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-2586@lists.php.net to get a copy of this message
By the way, if you are worried about performance you can use do_alloca() and free_alloca() instead of emalloc()/efree(). In this case the emalloc() is probably negligable. Andi At 05:30 PM 11/13/00 +0000, Thies C. Arntzen wrote:
thies           Mon Nov 13 09:30:52 2000 EDT
Modified files:
    /php4/ext/oci8      oci8.c
Log: @- Fixed column-title buffer-overflow in OCIFetchStatement(). (Thies) fix #7784 Index: php4/ext/oci8/oci8.c diff -u php4/ext/oci8/oci8.c:1.102 php4/ext/oci8/oci8.c:1.103 --- php4/ext/oci8/oci8.c:1.102 Sun Oct 29 01:14:52 2000
+++ php4/ext/oci8/oci8.c        Mon Nov 13 09:30:52 2000
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
*/ -/* $Id: oci8.c,v 1.102 2000/10/29 09:14:52 thies Exp $ */ +/* $Id: oci8.c,v 1.103 2000/11/13 17:30:52 thies Exp $ */ /* TODO list: * @@ -491,7 +491,7 @@
        php_info_print_table_start();
        php_info_print_table_row(2, "OCI8 Support", "enabled");
-       php_info_print_table_row(2, "Revision", "$Revision: 1.102 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.103 $");
#ifndef PHP_WIN32
        php_info_print_table_row(2, "Oracle Version", PHP_OCI8_VERSION );
        php_info_print_table_row(2, "Compile-time ORACLE_HOME", PHP_OCI8_DIR );
@@ -3461,7 +3461,7 @@
        int i;
        int mode = OCI_NUM;
        int rows = 0;
-       char namebuf[ 128 ];
+       char *namebuf;
        int ac = ZEND_NUM_ARGS();
        if (ac < 2 || ac > 3 || zend_get_parameters_ex(ac, &stmt, &array, &fmode) == FAILURE) {
@@ -3489,10 +3489,10 @@
                MAKE_STD_ZVAL(tmp);
                array_init(tmp);
-               memcpy(namebuf,columns[ i ]->name, columns[ i ]->name_len);
-               namebuf[ columns[ i ]->name_len ] = 0;
+               namebuf = estrndup(columns[ i ]->name,columns[ i ]->name_len);
                zend_hash_update((*array)->value.ht, namebuf, columns[ i ]->name_len+1, (void *) &tmp, sizeof(zval*), (void **) &(outarrs[ i ]));
+               efree(namebuf);
        }
        while (oci_fetch(statement, nrows, "OCIFetchStatement")) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-cvs-unsubscribe@lists.php.net For additional commands, e-mail: php-cvs-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
--- Andi Gutmans <andi@zend.com> http://www.zend.com/

« previous php.cvs (#2586) next »