ldb client controls: avoid talloc_memdup(x, y, (size_t)-1);
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 15 Mar 2016 23:46:12 +0000 (12:46 +1300)
committerJeremy Allison <jra@samba.org>
Fri, 18 Mar 2016 23:56:42 +0000 (00:56 +0100)
commite806824fc8841553102eefdd748b5c6d261f1bb7
tree1254becdd0111ee8343de69302a92bffac0d8399
parentac4dc0c678dddf1eab977dddfc4344d835be7824
ldb client controls: avoid talloc_memdup(x, y, (size_t)-1);

ldb_base64_decode() returns -1 if a string can't be parsed as base64,
and this is not the kind of value you want to use in talloc_memdup().

In these cases it can happen innocently if the strings are truncated
to fit in their buffers.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Mar 19 00:56:42 CET 2016 on sn-devel-144
lib/ldb/common/ldb_controls.c