mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-08-20 08:51:22 +08:00
Fix gcc-11 error "directive argument is null"
mdbtools triggered
In function ‘printf’,
inlined from ‘mdb_dump_catalog’ at catalog.c:195:4:
/usr/include/powerpc64le-linux-gnu/bits/stdio2.h:112:10:
error: ‘%-12s’ directive argument is null [-Werror=format-overflow=]
112 | return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
This is due to mdb_get_objtype_string potentially returning NULL
which isn't allowed anymore as it would cause a segfault on the latter
print.
Fixes: #352
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
This commit is contained in:
parent
5946750058
commit
22c379a611
@ -193,7 +193,7 @@ mdb_dump_catalog(MdbHandle *mdb, int obj_type)
|
|||||||
entry = g_ptr_array_index(mdb->catalog,i);
|
entry = g_ptr_array_index(mdb->catalog,i);
|
||||||
if (obj_type==MDB_ANY || entry->object_type==obj_type) {
|
if (obj_type==MDB_ANY || entry->object_type==obj_type) {
|
||||||
printf("Type: %-12s Name: %-48s Page: %06lx\n",
|
printf("Type: %-12s Name: %-48s Page: %06lx\n",
|
||||||
mdb_get_objtype_string(entry->object_type),
|
mdb_get_objtype_string(entry->object_type) ?: "Unknown",
|
||||||
entry->object_name,
|
entry->object_name,
|
||||||
entry->table_pg);
|
entry->table_pg);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user