cvs: php4 /ext/ldap ldap.c /ext/pdf pdf.c
| From: | Ilia Alshanetsky | Date: | Wed, 30 Apr 2003 21:53:52 +0000 |
| Subject: | cvs: php4 /ext/ldap ldap.c /ext/pdf pdf.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20618@lists.php.net to get a copy of this message | ||
iliaa Wed Apr 30 17:53:52 2003 EDT
Modified files:
/php4/ext/ldap ldap.c
/php4/ext/pdf pdf.c
Log:
emalloc -> safe_emalloc
Index: php4/ext/ldap/ldap.c
diff -u php4/ext/ldap/ldap.c:1.137 php4/ext/ldap/ldap.c:1.138
--- php4/ext/ldap/ldap.c:1.137 Fri Mar 7 09:03:53 2003
+++ php4/ext/ldap/ldap.c Wed Apr 30 17:53:52 2003
@@ -22,7 +22,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ldap.c,v 1.137 2003/03/07 14:03:53 iliaa Exp $ */
+/* $Id: ldap.c,v 1.138 2003/04/30 21:53:52 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.137 2003/03/07 14:03:53
iliaa Exp $" );
+ php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.138 2003/04/30 21:53:52
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_docref(NULL TSRMLS_CC, E_WARNING, "Could not allocate memory");
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++) {
@@ -1274,8 +1274,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 */
@@ -1311,7 +1311,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)) {
@@ -1703,7 +1703,7 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected non-empty array value for this
option");
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.120 php4/ext/pdf/pdf.c:1.121
--- php4/ext/pdf/pdf.c:1.120 Tue Feb 4 05:57:34 2003
+++ php4/ext/pdf/pdf.c Wed Apr 30 17:53:52 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdf.c,v 1.120 2003/02/04 10:57:34 steinm Exp $ */
+/* $Id: pdf.c,v 1.121 2003/04/30 21:53:52 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 */
@@ -332,7 +332,7 @@
#else
php_info_print_table_row(2, "PDFlib GmbH Version", tmp );
#endif
- php_info_print_table_row(2, "Revision", "$Revision: 1.120 $" );
+ php_info_print_table_row(2, "Revision", "$Revision: 1.121 $" );
php_info_print_table_end();
}
@@ -2457,7 +2457,7 @@
array = Z_ARRVAL_PP(arg2);
len = zend_hash_num_elements(array);
- darray = emalloc(len * sizeof(double));
+ darray = safe_emalloc(len, sizeof(double), 0);
zend_hash_internal_pointer_reset(array);
for (i=0; i<len; i++) {
zval *keydata, **keydataptr;