#32720 [Opn->Csd]: Wrong type in snmp.c
| From: | sniper@php.net | Date: | Fri, 15 Apr 2005 22:09:03 +0000 |
| Subject: | #32720 [Opn->Csd]: Wrong type in snmp.c | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-77614@lists.php.net to get a copy of this message | ||
ID: 32720
Updated by: sniper@php.net
Reported By: joropito at ciudad dot com dot ar
-Status: Open
+Status: Closed
Bug Type: SNMP related
-Operating System: FreeBSD 5.3 SPARC64
+Operating System: * (64bit)
-PHP Version: 5.0.4
+PHP Version: 4.*, 5.*
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2005-04-15 20:19:07] joropito at ciudad dot com dot ar
Here's a patch. It would be nice to be added in CVS snapshots and next
release.
--- ext/snmp.orig/snmp.c Fri Apr 15 15:07:20 2005
+++ ext/snmp/snmp.c Fri Apr 15 13:33:57 2005
@@ -352,9 +352,9 @@
struct snmp_pdu *pdu=NULL, *response;
struct variable_list *vars;
oid name[MAX_NAME_LEN];
- int name_length;
+ size_t name_length;
oid root[MAX_NAME_LEN];
- int rootlen = 0;
+ size_t rootlen = 0;
int gotroot = 0;
int status, count;
char buf[2048];
------------------------------------------------------------------------
[2005-04-15 16:25:41] joropito at ciudad dot com dot ar
Description:
------------
In php_snmp_internal() (snmp.c) its defined
int name_length; // length 4
int rootlen = 0; // length 4
but to be architecture portable it needs to be
size_t name_length; // length 8 on sparc64
size_t rootlen = 0; //length 8 on sparc64
like ucd/net-snmp defines at snmp_parse_oid()
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32720&edit=1