Prevent potential crash in libsmi.
authorBalint Reczey <balint.reczey@ericsson.com>
Thu, 25 Feb 2010 19:28:58 +0000 (19:28 -0000)
committerBalint Reczey <balint.reczey@ericsson.com>
Thu, 25 Feb 2010 19:28:58 +0000 (19:28 -0000)
From: Vincent Bernat <bernat@debian.org>

svn path=/trunk/; revision=32006

epan/oids.c
tools/asn2wrs.py

index d59a73aa3e3a0470db90cf22b8f0fcbd0178bbd4..6501cba7e778554cb2e0ccbd1840343a457b0a46 100644 (file)
@@ -587,6 +587,18 @@ static void register_mibs(void) {
 
                D(3,("\tModule: %s", smiModule->name));
 
+               /* TODO: Check libsmi version at compile time and disable this
+                * workaround for libsmi versions where this problem is fixed.
+                * Currently there is no such version. :-(
+                */
+               if (smiModule->conformance <= 1)
+                       report_failure("Stopped processing module %s due to "
+                               "error(s) to prevent potential crash in libsmi.\n"
+                               "Module's conformance level: %d.\n"
+                               "See details at: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560325\n",
+                                smiModule->name, smiModule->conformance);
+                       continue;
+
                for (smiNode = smiGetFirstNode(smiModule, SMI_NODEKIND_ANY);
                         smiNode;
                         smiNode = smiGetNextNode(smiNode, SMI_NODEKIND_ANY)) {
index c7b45926d6c68589c994716d54c1bc4840dd73a0..e52a91bda8fbeceb37cea7fc5f16c9333db904e0 100755 (executable)
@@ -47,8 +47,8 @@ import time
 import getopt
 import traceback
 
-import lex
-import yacc
+from ply import lex
+from ply import yacc
 
 # OID name -> number conversion table
 oid_names = {