ldb_controls: control_to_string avoids crash
commit2aace18f170644da9c293342a6df5e5b2ae8da25
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Fri, 24 Jul 2020 00:41:29 +0000 (24 12:41 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 29 Jul 2020 04:43:23 +0000 (29 04:43 +0000)
treea5ad3a943aeb0a2ec4363a8325ed854d3683198f
parent05228c4e07013c0e6f78f1330b3b787271282ca8
ldb_controls: control_to_string avoids crash

Otherwise a malformed control with unexpected NULL data will segfault
ldb_control_to_string(), though this is not very likely to affect
anyone in practice as converting controls to strings is rarely
necessary. If it happens at all in Samba it is in Python code.

Found by Honggfuzz using fuzz_ldb_parse_control.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Jul 29 04:43:23 UTC 2020 on sn-devel-184
lib/ldb/common/ldb_controls.c