On 2006-02-01 17:25:04 +0000, Dave Shield wrote:
> it's objecting to, and how far through it gets.
> Could you perhaps try adding a debug print statement
> to that loop, that would indicate the value of the
> "oid_index" OID array at the point at which it fails.
while figuring out the best params for my printf debug statement i fell
over the bug.:) following the way of the first patch again an int vs
size_t.
the attached patch fixes the crashes.
the function definition of of netsnmp_tdata_row_get_byoid got me on the
right track:
[[[
/** finds a row in the 'tdata' table given the index OID */
netsnmp_tdata_row *
netsnmp_tdata_row_get_byoid(netsnmp_tdata *table,
oid * searchfor, size_t searchfor_len)
]]]
but the passed elements of the row struct where defined as:
[[[
typedef struct netsnmp_index_s {
int len;
oid *oids;
} netsnmp_index;
]]]
changing the length to size_t fixed the crashes.:)
have a nice day. :)
darix
--
openSUSE - SUSE Linux is my linux
openSUSE is good for you
www.opensuse.org
Index: agent/agent_registry.c
===================================================================
--- agent/agent_registry.c.orig
+++ agent/agent_registry.c
@@ -1451,7 +1451,7 @@
lookup_cache *lookup_cache = NULL;
netsnmp_subtree *myptr = NULL, *previous = NULL;
int cmp = 1;
- int ll_off = 0;
+ size_t ll_off = 0;
if (subtree) {
myptr = subtree;
Index: include/net-snmp/types.h
===================================================================
--- include/net-snmp/types.h.orig
+++ include/net-snmp/types.h
@@ -144,7 +144,7 @@
*/
typedef struct netsnmp_index_s {
- int len;
+ size_t len;
oid *oids;
} netsnmp_index;