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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Sun Dec 22 01:01:30 2024 UTC