[Pkg-net-snmp-devel] Bug#514842: libsnmp-python: segmentation fault in python bindings on null session

Gabriele Messineo gabriele.messineo at winext.eu
Wed Feb 11 10:55:26 UTC 2009

Package: libsnmp-python
Version: 5.4.1~dfsg-12
Severity: important


I was able to reproduce a bug affecting python bindings.

When creating a snmpv3 session towards an _unreachable_ host libsnmp-python caused a segfault when calling the get method.

It stores a null pointer as session pointer, and that is passed onwards to the snmpget code.

Actually this issue can be skipped in python by checking:

if sess.sess_ptr != 0:

but probably it would make sense to avoid creating the session object at all (so in the Session class contructor in python/netsnmp/client.py by raising an exception).

code to reproduce the issue:

import netsnmp
myvars = netsnmp.VarList(netsnmp.Varbind('.', iid = ''))
sess = netsnmp.Session(Version = 3,SecLevel = 'noAuthPriv' , DestHost = '', SecName= 'fake_user', Retries = 1, Timeout = 5 * 1000000)
res = sess.get(myvars)


Gabriele Messineo

-- System Information:
Debian Release: 5.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libsnmp-python depends on:
ii  libc6                      2.7-18        GNU C Library: Shared libraries
ii  libsnmp15                  5.4.1~dfsg-12 SNMP (Simple Network Management Pr
ii  python                     2.5.2-3       An interactive high-level object-o
ii  python-central             0.6.8         register and build utility for Pyt

libsnmp-python recommends no packages.

libsnmp-python suggests no packages.

-- no debconf information

More information about the Pkg-net-snmp-devel mailing list