lib tdb: memcmp ubsan warning
commita77fda0cd4b9ec89024c7ac8a3f77797e00f4263
authorGary Lockyer <gary@catalyst.net.nz>
Thu, 6 Jun 2019 02:57:45 +0000 (6 14:57 +1200)
committerNoel Power <npower@samba.org>
Mon, 1 Jul 2019 14:50:53 +0000 (1 14:50 +0000)
treee092862590691794c4ef37d3815389ef0b58fb4c
parent2b7236ffe1a0454756b76f8dc302649e92cefbaa
lib tdb: memcmp ubsan warning

Fix the ubsan warning

lib/tdb/common/tdb.c:184:9: runtime error: null pointer passed as
argument 2, which is declared to never be null"

memcmp call now guarded by a length check.

memcmp returns zero when called with a zero length parameter.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Mon Jul  1 14:50:54 UTC 2019 on sn-devel-184
lib/tdb/common/tdb.c