Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Empty string in second argument for set results in segmentation fault #197

Open
bmitc opened this issue Jan 31, 2024 · 1 comment
Open
Labels

Comments

@bmitc
Copy link

bmitc commented Jan 31, 2024

EasySNMP release version OR commit number
easysnmp-0.2.6. Specifically: easysnmp-0.2.6-cp310-cp310-manylinux_2_24_x86_64.whl

Operating System and Version

  • OS: Ubuntu
  • Version: 22.04

Net-SNMP Library Version
Not sure at the moment.

Describe the bug
Passing an empty string for the second argument in a set method call results in a segmentation fault.

>>> session.set('.1.3.6.1.4.1.3808.1.1.3.3.3.1.1.4.1.3', '')
Segmentation fault
$ <exits back to console>

To Reproduce
See bug description.

Expected behavior
No segmentation fault. At the worst, an exception should be raised.

Screenshots
n/a

Additional context
This was found while I am coming up to speed on SNMP to remotely control a Cyberpower PDU.

@bmitc bmitc added the bug label Jan 31, 2024
@bmitc
Copy link
Author

bmitc commented Feb 1, 2024

I'm seeing more segmentation faults with set today as well in other instances. Even something as simple as:

session.set('.1.3.6.1.4.1.3808.1.1.3.3.3.1.1.4.1', '2')

segfaults.

It's possible that this is not the correct command for my device, but an exception is expected. A segmentation fault should always be treated as a bug.

I'm not sure of the exact issues, but I'm starting to feel that this library is not well-suited for inclusion in applications that need to be highly reliable and robust. This isn't a judgement, just an observation relevant to these bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant