cvs: php4 /ext/snmp snmp.c
| From: | Sterling Hughes | Date: | Sat, 01 Jul 2000 21:34:45 +0000 |
| Subject: | cvs: php4 /ext/snmp snmp.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-581@lists.php.net to get a copy of this message | ||
sterling Sat Jul 1 14:34:45 2000 EDT
Modified files:
/php4/ext/snmp snmp.c
Log:
- strdup -> estrdup
- check whether return_value array is initialized.
Index: php4/ext/snmp/snmp.c
diff -u php4/ext/snmp/snmp.c:1.34 php4/ext/snmp/snmp.c:1.35
--- php4/ext/snmp/snmp.c:1.34 Sat Jun 24 08:31:11 2000
+++ php4/ext/snmp/snmp.c Sat Jul 1 14:34:45 2000
@@ -17,7 +17,7 @@
| Steven Lawrance <slawrance@technologist.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: snmp.c,v 1.34 2000/06/24 15:31:11 sas Exp $ */
+/* $Id: snmp.c,v 1.35 2000/07/01 21:34:45 sterling Exp $ */
#include "php.h"
#include "ext/standard/info.h"
@@ -86,7 +86,14 @@
};
zend_module_entry snmp_module_entry = {
- "snmp",snmp_functions,PHP_MINIT(snmp),NULL,NULL,NULL,PHP_MINFO(snmp),STANDARD_MODULE_PROPERTIES
+ "snmp",
+ snmp_functions,
+ PHP_MINIT(snmp),
+ NULL,
+ NULL,
+ NULL,
+ PHP_MINFO(snmp),
+ STANDARD_MODULE_PROPERTIES
};
#ifdef COMPILE_DL_SNMP
@@ -210,9 +217,9 @@
* memory it did not allocate
*/
#ifdef UCD_SNMP_HACK
- session.community = (u_char *) strdup((*a2)->value.str.val);
+ session.community = (u_char *)estrdup((*a2)->value.str.val);
#else
- session.community = (u_char *) (*a2)->value.str.val;
+ session.community = (u_char *)(*a2)->value.str.val;
#endif
session.community_len = (*a2)->value.str.len;
session.retries = retries;
@@ -229,7 +236,10 @@
if (st >= 2) {
memmove((char *)name, (char *)root, rootlen * sizeof(oid));
name_length = rootlen;
- array_init(return_value); /* prepare result array */
+ if (array_init(return_value) == FAILURE) {
+ php_error(E_WARNING, "Cannot prepare result array");
+ RETURN_FALSE;
+ }
}
while(keepwalking) {