mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
lib/tdb/common: Fix warning: Null pointer passed as argument to param
Fixes: lib/tdb/common/rescue.c:299:2: warning: Null pointer passed as an argument to a 'nonnull' parameter <--[clang] qsort(found.arr, found.num, sizeof(found.arr[0]), cmp_key); ^ ~~~~~~~~~ Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
This commit is contained in:
parent
dcaaf9ff7a
commit
848290d37f
@ -296,9 +296,11 @@ _PUBLIC_ int tdb_rescue(struct tdb_context *tdb,
|
||||
}
|
||||
|
||||
/* Now sort by key! */
|
||||
qsort(found.arr, found.num, sizeof(found.arr[0]), cmp_key);
|
||||
if (found.arr != NULL) {
|
||||
qsort(found.arr, found.num, sizeof(found.arr[0]), cmp_key);
|
||||
}
|
||||
|
||||
for (i = 0; i < found.num; ) {
|
||||
for (i = 0; found.arr && i < found.num; ) {
|
||||
unsigned int num, num_in_hash = 0;
|
||||
|
||||
/* How many are identical? */
|
||||
|
Loading…
x
Reference in New Issue
Block a user