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

python3 bindings fails with Hex-STRING #216

Closed
dheule opened this issue Nov 30, 2020 · 4 comments
Closed

python3 bindings fails with Hex-STRING #216

dheule opened this issue Nov 30, 2020 · 4 comments

Comments

@dheule
Copy link

dheule commented Nov 30, 2020

On my Linux System with NET-SNMP version: 5.9 I found the follwoing problem in the python3 binding:

If you try to recive an Hex-String value, it fails. If this Hex-String is a part of walk or bulk operation, it segfaults the whole python.

Example test script:

#!/usr/bin/python3

import netsnmp

session = netsnmp.Session(DestHost='localhost', Community='public', Version=2, Timeout=2000000, Retries=5, UseNumeric=1)

print("Try to recive a Hex-STRING via get:")
try:
    myvar = netsnmp.VarList(netsnmp.Varbind('.1.3.6.1.6.3.10.2.1.1.0'))
    session.get(myvar)

    for var in myvar:
        print(var)

except Exception as e:
    print(e)

print("Try to recive a Hex-STRING as part of walk or bulk:")
myvar = netsnmp.VarList(netsnmp.Varbind('.1.3.6.1.6.3.10'))
session.walk(myvar)

for var in myvar:
    print(var)

gets the following output:

./test.py
Try to recive a Hex-STRING via get:
<built-in function get> returned a result with an error set
Try to recive a Hex-STRING as part of walk or bulk:
Segmentation fault

Please help to fix this, because it renders the whole binding unstable ...

@bvanassche
Copy link
Contributor

Thanks for having reported this. I will take a look.

bvanassche added a commit that referenced this issue Dec 6, 2020
@bvanassche
Copy link
Contributor

Please retest with the latest version of the V5-9-patches branch (https://github.com/net-snmp/net-snmp/tree/V5-9-patches).

@dheule
Copy link
Author

dheule commented Dec 9, 2020

I have tested, for my case it's workig. Thank you.

@bvanassche
Copy link
Contributor

Thanks for the feedback!

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

No branches or pull requests

2 participants