Sorry for the delay in following up on this.
I've just stumbled across this message again,
and spotted a couple of things that look dangerous:
> mobileAgentTable_get_first_data_point(void **my_loop_context,
> void **my_data_context,
> netsnmp_variable_list *put_index_data,
> netsnmp_iterator_info *mydata)
> {
> //Get the first node (line) of the structure (linked list)
> ptMarcaTemp = primeiro_no();
>
> if( strcmp(ptMarcaTemp->info->nome, "ULTIMO") == 0)
What if 'ptMarcaTemp' is NULL?
You're dereferencing the pointer, without checking it first.
> netsnmp_variable_list *
> mobileAgentTable_get_next_data_point(void **my_loop_context,
> void **my_data_context,
> netsnmp_variable_list *put_index_data,
> netsnmp_iterator_info *mydata)
> {
> marca* ptMarcaTemp;
> ptMarcaTemp = *my_loop_context;
> ptMarcaTemp = ptMarcaTemp->prox;
>
> if( strcpy(ptMarcaTemp->info->nome, "ULTIMO") == 0)
Same here.
Now you may *expect* the ptMarcaTemp pointer to always be valid,
but it's sensible to test this before dereferencing it.
> The problem is: segmentation fault error apears when one of
> the hooks return NULL and the table is empty.
That's exactly the symptoms I'd expect to see when derefencing
a NULL pointer.
> Other problem is when I get one column of the table. The result is displayed
> in HEX-STRING but I didn“t do any modification of the data type.
What's the expected type?
What is the MIB definition of this object?
What is the hex value that you receive
(as compared to the expected value)
What version of the tools are you using?
(tools rather than agent)
Dave
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders