iliaa           Mon Dec 25 21:41:04 2006 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/interbase      ibase_query.c 
    /php-src/ext/json   json.c 
    /php-src/ext/oci8   oci8_statement.c 
    /php-src/ext/pdo_dblib      dblib_driver.c dblib_stmt.c 
    /php-src/ext/standard       uuencode.c var.c 
  Log:
  Use safe_emalloc()
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/interbase/ibase_query.c?r1=1.23.2.1.2.1&r2=1.23.2.1.2.2&diff_format=u
Index: php-src/ext/interbase/ibase_query.c
diff -u php-src/ext/interbase/ibase_query.c:1.23.2.1.2.1 
php-src/ext/interbase/ibase_query.c:1.23.2.1.2.2
--- php-src/ext/interbase/ibase_query.c:1.23.2.1.2.1    Thu Nov 30 16:21:24 2006
+++ php-src/ext/interbase/ibase_query.c Mon Dec 25 21:41:04 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: ibase_query.c,v 1.23.2.1.2.1 2006/11/30 16:21:24 iliaa Exp $ */
+/* $Id: ibase_query.c,v 1.23.2.1.2.2 2006/12/25 21:41:04 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1146,7 +1146,7 @@
                                break;
                        }
                } else if (bind_n > 0) {
-                       bind_args = (zval ***) emalloc(sizeof(zval **) * 
ZEND_NUM_ARGS());
+                       bind_args = (zval ***) safe_emalloc(sizeof(zval **), 
ZEND_NUM_ARGS(), 0);
 
                        if (FAILURE == 
zend_get_parameters_array_ex(ZEND_NUM_ARGS(), bind_args)) {
                                break;
http://cvs.php.net/viewvc.cgi/php-src/ext/json/json.c?r1=1.9.2.8&r2=1.9.2.9&diff_format=u
Index: php-src/ext/json/json.c
diff -u php-src/ext/json/json.c:1.9.2.8 php-src/ext/json/json.c:1.9.2.9
--- php-src/ext/json/json.c:1.9.2.8     Tue Dec 19 15:01:05 2006
+++ php-src/ext/json/json.c     Mon Dec 25 21:41:04 2006
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: json.c,v 1.9.2.8 2006/12/19 15:01:05 nlopess Exp $ */
+/* $Id: json.c,v 1.9.2.9 2006/12/25 21:41:04 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -242,7 +242,7 @@
         return;
     }
 
-    utf16 = (unsigned short *) emalloc(len * sizeof(unsigned short));
+    utf16 = (unsigned short *) safe_emalloc(len, sizeof(unsigned short), 0);
 
     len = utf8_to_utf16(utf16, s, len);
     if (len <= 0)
@@ -421,7 +421,7 @@
         RETURN_NULL();
     }
 
-    utf16 = (unsigned short *) emalloc((parameter_len+1) * sizeof(unsigned 
short));
+    utf16 = (unsigned short *) safe_emalloc((parameter_len+1), sizeof(unsigned 
short), 1);
 
     utf16_len = utf8_to_utf16(utf16, parameter, parameter_len);
     if (utf16_len <= 0)
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_statement.c?r1=1.7.2.14.2.15&r2=1.7.2.14.2.16&diff_format=u
Index: php-src/ext/oci8/oci8_statement.c
diff -u php-src/ext/oci8/oci8_statement.c:1.7.2.14.2.15 
php-src/ext/oci8/oci8_statement.c:1.7.2.14.2.16
--- php-src/ext/oci8/oci8_statement.c:1.7.2.14.2.15     Fri Nov 10 20:13:36 2006
+++ php-src/ext/oci8/oci8_statement.c   Mon Dec 25 21:41:04 2006
@@ -25,7 +25,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: oci8_statement.c,v 1.7.2.14.2.15 2006/11/10 20:13:36 tony2001 Exp $ */
+/* $Id: oci8_statement.c,v 1.7.2.14.2.16 2006/12/25 21:41:04 iliaa Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -1363,7 +1363,7 @@
        hash = HASH_OF(var);
 
        bind = emalloc(sizeof(php_oci_bind));
-       bind->array.elements            = (ub4 *)emalloc(max_table_length * 
sizeof(ub4));
+       bind->array.elements            = (ub4 *)safe_emalloc(max_table_length, 
sizeof(ub4), 0);
        bind->array.current_length      = 
zend_hash_num_elements(Z_ARRVAL_P(var));
        bind->array.old_length          = bind->array.current_length;
        bind->array.max_length          = sizeof(ub4);
@@ -1399,7 +1399,7 @@
        hash = HASH_OF(var);
 
        bind = emalloc(sizeof(php_oci_bind));
-       bind->array.elements            = (double *)emalloc(max_table_length * 
sizeof(double));
+       bind->array.elements            = (double 
*)safe_emalloc(max_table_length, sizeof(double), 0);
        bind->array.current_length      = 
zend_hash_num_elements(Z_ARRVAL_P(var));
        bind->array.old_length          = bind->array.current_length;
        bind->array.max_length          = sizeof(double);
@@ -1435,7 +1435,7 @@
        hash = HASH_OF(var);
 
        bind = emalloc(sizeof(php_oci_bind));
-       bind->array.elements            = (OCIDate *)emalloc(max_table_length * 
sizeof(OCIDate));
+       bind->array.elements            = (OCIDate 
*)safe_emalloc(max_table_length, sizeof(OCIDate), 0);
        bind->array.current_length      = 
zend_hash_num_elements(Z_ARRVAL_P(var));
        bind->array.old_length          = bind->array.current_length;
        bind->array.max_length          = sizeof(OCIDate);
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_dblib/dblib_driver.c?r1=1.9.2.2&r2=1.9.2.2.2.1&diff_format=u
Index: php-src/ext/pdo_dblib/dblib_driver.c
diff -u php-src/ext/pdo_dblib/dblib_driver.c:1.9.2.2 
php-src/ext/pdo_dblib/dblib_driver.c:1.9.2.2.2.1
--- php-src/ext/pdo_dblib/dblib_driver.c:1.9.2.2        Sun Jan  1 12:47:32 2006
+++ php-src/ext/pdo_dblib/dblib_driver.c        Mon Dec 25 21:41:04 2006
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: dblib_driver.c,v 1.9.2.2 2006/01/01 12:47:32 sniper Exp $ */
+/* $Id: dblib_driver.c,v 1.9.2.2.2.1 2006/12/25 21:41:04 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -144,7 +144,7 @@
        char *q;
        int l = 1;
 
-       *quoted = q = emalloc(2 * unquotedlen + 3);
+       *quoted = q = safe_emalloc(2, unquotedlen, 3);
        *q++ = '\'';
 
        while (unquotedlen--) {
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_dblib/dblib_stmt.c?r1=1.6.2.2&r2=1.6.2.2.2.1&diff_format=u
Index: php-src/ext/pdo_dblib/dblib_stmt.c
diff -u php-src/ext/pdo_dblib/dblib_stmt.c:1.6.2.2 
php-src/ext/pdo_dblib/dblib_stmt.c:1.6.2.2.2.1
--- php-src/ext/pdo_dblib/dblib_stmt.c:1.6.2.2  Sun Jan  1 12:47:32 2006
+++ php-src/ext/pdo_dblib/dblib_stmt.c  Mon Dec 25 21:41:04 2006
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: dblib_stmt.c,v 1.6.2.2 2006/01/01 12:47:32 sniper Exp $ */
+/* $Id: dblib_stmt.c,v 1.6.2.2.2.1 2006/12/25 21:41:04 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -131,7 +131,7 @@
 
        arows = 100;
        size = S->ncols * sizeof(pdo_dblib_colval);
-       S->rows = emalloc(arows * size);
+       S->rows = safe_emalloc(arows, size, 0);
 
        /* let's fetch all the data */
        do {
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/uuencode.c?r1=1.5.2.1.2.1&r2=1.5.2.1.2.2&diff_format=u
Index: php-src/ext/standard/uuencode.c
diff -u php-src/ext/standard/uuencode.c:1.5.2.1.2.1 
php-src/ext/standard/uuencode.c:1.5.2.1.2.2
--- php-src/ext/standard/uuencode.c:1.5.2.1.2.1 Mon Jun 26 18:48:56 2006
+++ php-src/ext/standard/uuencode.c     Mon Dec 25 21:41:04 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: uuencode.c,v 1.5.2.1.2.1 2006/06/26 18:48:56 bjori Exp $ */
+/* $Id: uuencode.c,v 1.5.2.1.2.2 2006/12/25 21:41:04 iliaa Exp $ */
 
 /*
  * Portions of this code are based on Berkeley's uuencode/uudecode
@@ -71,7 +71,7 @@
        char *p, *s, *e, *ee;
 
        /* encoded length is ~ 38% greater then the original */
-       p = *dest = emalloc((ceil(src_len * 1.38) + 45 + 1));
+       p = *dest = safe_emalloc(ceil(src_len * 1.38), 1, 46);
        s = src;
        e = src + src_len;
 
@@ -128,7 +128,7 @@
        int len, total_len=0;
        char *s, *e, *p, *ee;
 
-       p = *dest = emalloc(ceil(src_len * 0.75) + 1);
+       p = *dest = safe_emalloc(ceil(src_len * 0.75), 1, 1);
        s = src;
        e = src + src_len;
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var.c?r1=1.203.2.7.2.12&r2=1.203.2.7.2.13&diff_format=u
Index: php-src/ext/standard/var.c
diff -u php-src/ext/standard/var.c:1.203.2.7.2.12 
php-src/ext/standard/var.c:1.203.2.7.2.13
--- php-src/ext/standard/var.c:1.203.2.7.2.12   Wed Dec 20 10:49:32 2006
+++ php-src/ext/standard/var.c  Mon Dec 25 21:41:04 2006
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: var.c,v 1.203.2.7.2.12 2006/12/20 10:49:32 dmitry Exp $ */
+/* $Id: var.c,v 1.203.2.7.2.13 2006/12/25 21:41:04 iliaa Exp $ */
 
 
 
@@ -691,7 +691,7 @@
                                char *s;
 
                                smart_str_appendl(buf, "d:", 2);
-                               s = (char *) emalloc(MAX_LENGTH_OF_DOUBLE + 
PG(serialize_precision) + 1);
+                               s = (char *) 
safe_emalloc(PG(serialize_precision), 1, MAX_LENGTH_OF_DOUBLE + 1);
                                php_gcvt(Z_DVAL_P(struc), 
PG(serialize_precision), '.', 'E', s);
                                smart_str_appends(buf, s);
                                smart_str_appendc(buf, ';');

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

Reply via email to