#65 mdb-schema segmentation fault

open
nobody
5
2004-08-05
2004-08-05
Ian Becker
No

mdbtools v0.6pre1

If mdb_open() fails, mdb-schema dies with a
segmentation fault. Here's a suggested patch for it:

--- mdb-schema.c.orig 2004-08-05 11:00:30.346352000 -0400
+++ mdb-schema.c 2004-08-05 11:05:19.446983000 -0400
@@ -70,6 +70,10 @@
/* open the database */

mdb = mdb_open (argv[optind], MDB_NOFLAGS);
+ if(NULL == mdb) {
+ fprintf(stderr,"Could not open file
%s\n",argv[optind]);
+ exit(1);
+ }
if (argc - optind >= 2) {
if (!mdb_set_default_backend(mdb, argv[optind +
1])) {
fprintf(stderr,"Invalid backend type\n");

Discussion