-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Using net-snmp I'm fetching a certain value which always comes back as a mixture of different encoding formats. For example, one the results was 210235399110D1000030\x00. Looking through the library, I've singled-out this line as the main cause:
net-snmp/lib/net/snmp/varbind.rb
Line 34 in 490fa59
| struct.val[:string].read_string(struct.val_len) |
Problem is, the struct val has different length than the string being fetched. This will cause the #read_string call to access an invalid memory address (the "\x00"), causing the misleading output above. I've corrected it by just calling:
# lib/net/snmp/varbind.rb:36
struct.val[:string].read_stringis this enough? Or is the call with the length there for some reason I'm not getting?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels