php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32720 Wrong type in snmp.c
Submitted: 2005-04-15 16:25 UTC Modified: 2005-04-16 00:09 UTC
From: joropito at ciudad dot com dot ar Assigned:
Status: Closed Package: SNMP related
PHP Version: 4.*, 5.* OS: * (64bit)
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: joropito at ciudad dot com dot ar
New email:
PHP Version: OS:

 

 [2005-04-15 16:25 UTC] 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()




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-15 20:19 UTC] 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-16 00:09 UTC] sniper@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC