PERFORCE change 79503 for review
soc-victor
soc-victor at FreeBSD.org
Sun Jul 3 20:53:30 GMT 2005
http://perforce.freebsd.org/chv.cgi?CH=79503
Change 79503 by soc-victor at soc-victor_82.76.158.176 on 2005/07/03 20:53:03
Minor fixes for the gensnmpdef tool to prevent some SIGSEGVs when no mibs specified on
the comamnd line.
Affected files ...
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/gensnmpdef/gensnmpdef.c#2 edit
Differences ...
==== //depot/projects/soc2005/bsnmp/contrib/bsnmp/gensnmpdef/gensnmpdef.c#2 (text+ko) ====
@@ -371,6 +371,11 @@
long u;
char *end;
+ if ( argc <= 1 ){
+ fprintf(stderr, usgtxt);
+ exit(0);
+ }
+
smiInit(NULL);
while ((opt = getopt(argc, argv, "c:h")) != -1)
@@ -396,6 +401,11 @@
argc -= optind;
argv += optind;
+ if( argc == 0 ){
+ fprintf(stderr,"No MIB specified\n");
+ exit(0);
+ }
+
flags = smiGetFlags();
flags |= SMI_FLAG_ERRORS;
smiSetFlags(flags);
@@ -424,6 +434,10 @@
break;
}
}
- level = close_node(last->oidlen - 1, level - 1);
+ if( last != NULL ){
+ level = close_node(last->oidlen - 1, level - 1);
+ }
+
+ free(mods);
return (0);
}
More information about the p4-projects
mailing list