Skip to content

Net-SNMP not properly parsing output #11

@HoneyryderChuck

Description

@HoneyryderChuck

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:

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_string

is this enough? Or is the call with the length there for some reason I'm not getting?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions