]> git.ipfire.org Git - thirdparty/samba.git/commit
ldb: Avoid undefined pointer arithmetic
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 20 Feb 2023 20:42:28 +0000 (09:42 +1300)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 12 Apr 2023 13:52:31 +0000 (13:52 +0000)
commit6ef23456c39ba57bbdd4d24f84f6556c5e94de95
tree15ba14c6f8e3b54d1bc56fcee0bb4083a0681485
parentaedbee5fd2fa2c161c5bd386d1fa25c665f971c2
ldb: Avoid undefined pointer arithmetic

Computing a pointer that points outside of an array, and not to one past
the last element, is undefined behaviour. To avoid this, do our
comparisons in terms of lengths, not pointers.

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