darsto/cber

snmp_decode_msg and strings

Opened this issue · 3 comments

Darek,

This is an amazing piece of work! I actually visited Gdansk way before you were born, when the Russians were there.

Anyway, two issues (and I can provide code later):

  • the varbinds_num is not updated during processing in snmp_decode_msg
  • you cannot return a string using a pointer to its value in the buffer, as its not null terminated

You were on the right track with mallocing memory for strings. You could move the string back one byte position, then zero out the last byte, but then you'd be modifying the buffer.

Really, this is all I've found! I plan to upload my own framework with your code included, and will reference you then of course.

The README file does not do justice to your project - you should show the snmp_msg_test code - this is the power of what you did not the ber. Many people are looking for this and you are hiding it!!!

I just uploaded my project, which is a superset of what you did. It has slightly modified per/snmp files to address a couple of bugs and add more SNMP_DATA_T_ types.

you can diff the four .c and .h files to see the changes: https://github.com/dhoerl/cber

Again, you did 99% of the work and I still remained very impressed with your work!!!