ldb: Don't wrongly claim to return message elements
commit0ff26aa0c5f49466aca1db439a49f8dc08e4078e
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 26 Jan 2023 19:02:18 +0000 (27 08:02 +1300)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 12 Apr 2023 13:52:31 +0000 (12 13:52 +0000)
tree80d21b4a994d690f5da44bb09019a586a8faabc1
parentcb3c344a64335e8ad1555faf170105265e587e4f
ldb: Don't wrongly claim to return message elements

If the LDB_UNPACK_DATA_FLAG_NO_ATTRS flag is set, we don't return any
elements, so we should set num_elements accordingly. This ensures
callers don't try to access elements that aren't there.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
lib/ldb/common/ldb_pack.c