[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-cvs
Subject:    [PHP-CVS] cvs: php4(PHP_4_3) /ext/ldap ldap.c  /ext/pdf pdf.c
From:       "Ilia Alshanetsky" <ilia () prohost ! org>
Date:       2003-04-30 21:54:02
[Download RAW message or body]

iliaa		Wed Apr 30 17:54:02 2003 EDT

  Modified files:              (Branch: PHP_4_3)
    /php4/ext/ldap	ldap.c 
    /php4/ext/pdf	pdf.c 
  Log:
  MFH
  
  
Index: php4/ext/ldap/ldap.c
diff -u php4/ext/ldap/ldap.c:1.130.2.3 php4/ext/ldap/ldap.c:1.130.2.4
--- php4/ext/ldap/ldap.c:1.130.2.3	Fri Mar  7 09:08:06 2003
+++ php4/ext/ldap/ldap.c	Wed Apr 30 17:54:02 2003
@@ -22,7 +22,7 @@
    +----------------------------------------------------------------------+
  */
  
-/* $Id: ldap.c,v 1.130.2.3 2003/03/07 14:08:06 iliaa Exp $ */
+/* $Id: ldap.c,v 1.130.2.4 2003/04/30 21:54:02 iliaa Exp $ */
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
@@ -286,7 +286,7 @@
 
 	php_info_print_table_start();
 	php_info_print_table_row(2, "LDAP Support", "enabled" );
-	php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.130.2.3 2003/03/07 \
14:08:06 iliaa Exp $" ); +	php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v \
1.130.2.4 2003/04/30 21:54:02 iliaa Exp $" );  
 	if (LDAPG(max_links) == -1) {
 		snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links));
@@ -564,7 +564,7 @@
 			}
 
 			num_attribs = zend_hash_num_elements(Z_ARRVAL_PP(attrs));
-			if ((ldap_attrs = emalloc((num_attribs+1) * sizeof(char *))) == NULL) {
+			if ((ldap_attrs = safe_emalloc((num_attribs+1), sizeof(char *), 0)) == NULL) {
 				php_error(E_WARNING, "%s(): Could not allocate memory", \
get_active_function_name(TSRMLS_C));  RETURN_FALSE;
 			}
@@ -644,8 +644,8 @@
 			ldap_filter = Z_STRVAL_PP(filter);
 		}
 
-		lds = emalloc(nlinks * sizeof(ldap_linkdata));
-		rcs = emalloc(nlinks * sizeof(*rcs));
+		lds = safe_emalloc(nlinks, sizeof(ldap_linkdata), 0);
+		rcs = safe_emalloc(nlinks, sizeof(*rcs), 0);
 		
 		zend_hash_internal_pointer_reset(Z_ARRVAL_PP(link));
 		for (i=0; i<nlinks; i++) {
@@ -1285,8 +1285,8 @@
 	ldap_dn = Z_STRVAL_PP(dn);
 
 	num_attribs = zend_hash_num_elements(Z_ARRVAL_PP(entry));
-	ldap_mods = emalloc((num_attribs+1) * sizeof(LDAPMod *));
-	num_berval = emalloc(num_attribs * sizeof(int));
+	ldap_mods = safe_emalloc((num_attribs+1), sizeof(LDAPMod *), 0);
+	num_berval = safe_emalloc(num_attribs, sizeof(int), 0);
 	zend_hash_internal_pointer_reset(Z_ARRVAL_PP(entry));
 
 	/* added by gerrit thomson to fix ldap_add using ldap_mod_add */
@@ -1322,7 +1322,7 @@
 		}
 		
 		num_berval[i] = num_values;
-		ldap_mods[i]->mod_bvalues = emalloc((num_values + 1) * sizeof(struct berval *));
+		ldap_mods[i]->mod_bvalues = safe_emalloc((num_values + 1), sizeof(struct berval \
*), 0);  
 /* allow for arrays with one element, no allowance for arrays with none but probably \
not required, gerrit thomson. */  if ((num_values == 1) && (Z_TYPE_PP(value) != \
IS_ARRAY)) { @@ -1714,7 +1714,7 @@
 				php_error(E_WARNING, "%s(): Expected non-empty array value for this option", \
get_active_function_name(TSRMLS_C));  RETURN_FALSE;
                         }
-			ctrls = emalloc((1 + ncontrols) * sizeof(*ctrls));
+			ctrls = safe_emalloc((1 + ncontrols), sizeof(*ctrls), 0);
 			*ctrls = NULL;
 			ctrlp = ctrls;
 			zend_hash_internal_pointer_reset(Z_ARRVAL_PP(newval));
Index: php4/ext/pdf/pdf.c
diff -u php4/ext/pdf/pdf.c:1.112.2.4 php4/ext/pdf/pdf.c:1.112.2.5
--- php4/ext/pdf/pdf.c:1.112.2.4	Thu Jan 16 16:18:55 2003
+++ php4/ext/pdf/pdf.c	Wed Apr 30 17:54:02 2003
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: pdf.c,v 1.112.2.4 2003/01/16 21:18:55 iliaa Exp $ */
+/* $Id: pdf.c,v 1.112.2.5 2003/04/30 21:54:02 iliaa Exp $ */
 
 /* pdflib 2.02 ... 3.0x is subject to the ALADDIN FREE PUBLIC LICENSE.
    Copyright (C) 1997-1999 Thomas Merz. 2000-2001 PDFlib GmbH */
@@ -331,7 +331,7 @@
 #else
 	php_info_print_table_row(2, "PDFlib GmbH Version", tmp );
 #endif
-	php_info_print_table_row(2, "Revision", "$Revision: 1.112.2.4 $" );
+	php_info_print_table_row(2, "Revision", "$Revision: 1.112.2.5 $" );
 	php_info_print_table_end();
 
 }
@@ -2459,7 +2459,7 @@
 	array = Z_ARRVAL_PP(arg2);
 	len = zend_hash_num_elements(array);
 
-	if (NULL == (darray = emalloc(len * sizeof(double)))) {
+	if (NULL == (darray = safe_emalloc(len, sizeof(double), 0))) {
 	    RETURN_FALSE;
 	}
 	zend_hash_internal_pointer_reset(array);



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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic