mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-11-26 02:09:49 +08:00
Fix some potential segmentation faults
This commit is contained in:
@@ -2,6 +2,7 @@ Thu Jun 16 21:19:37 CDT 2005 Jeff Smith <whydoubt@yahoo.com>
|
|||||||
* src/libmdb/data.c: Fix segmentation fault
|
* src/libmdb/data.c: Fix segmentation fault
|
||||||
* src/libmdb/write.c: Fix bug in handling certain 'jump tables'
|
* src/libmdb/write.c: Fix bug in handling certain 'jump tables'
|
||||||
* src/util/mdb-schema.c: Handle 'file not found' case
|
* src/util/mdb-schema.c: Handle 'file not found' case
|
||||||
|
* src/libmdb/catalog.c: Fix some potential segmentation faults
|
||||||
|
|
||||||
Mon May 2 07:28:58 CDT 2005 Jeff Smith <whydoubt@yahoo.com>
|
Mon May 2 07:28:58 CDT 2005 Jeff Smith <whydoubt@yahoo.com>
|
||||||
* include/mdbtools.h:
|
* include/mdbtools.h:
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ void mdb_free_catalog(MdbHandle *mdb)
|
|||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
if (!mdb->catalog) return;
|
if ((!mdb) || (!mdb->catalog)) return;
|
||||||
for (i=0; i<mdb->catalog->len; i++)
|
for (i=0; i<mdb->catalog->len; i++)
|
||||||
g_free (g_ptr_array_index(mdb->catalog, i));
|
g_free (g_ptr_array_index(mdb->catalog, i));
|
||||||
g_ptr_array_free(mdb->catalog, TRUE);
|
g_ptr_array_free(mdb->catalog, TRUE);
|
||||||
@@ -68,6 +68,7 @@ GPtrArray *mdb_read_catalog (MdbHandle *mdb, int objtype)
|
|||||||
char obj_flags[256];
|
char obj_flags[256];
|
||||||
int type;
|
int type;
|
||||||
|
|
||||||
|
if (!mdb) return NULL;
|
||||||
if (mdb->catalog) mdb_free_catalog(mdb);
|
if (mdb->catalog) mdb_free_catalog(mdb);
|
||||||
mdb->catalog = g_ptr_array_new();
|
mdb->catalog = g_ptr_array_new();
|
||||||
mdb->num_catalog = 0;
|
mdb->num_catalog = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user