s3/rpc_client: Fix array offset check
commit885850b6aaabf089f422b1b015481a0ccff4f90e
authorNoel Power <noel.power@suse.com>
Thu, 8 Feb 2024 14:05:43 +0000 (8 14:05 +0000)
committerVolker Lendecke <vl@samba.org>
Sat, 17 Feb 2024 17:58:43 +0000 (17 17:58 +0000)
treed059e7ff90ede8e52635be28325493bbf050a926
parentf487211706a74d516bf447ed393222b4c0dce7b0
s3/rpc_client: Fix array offset check

Previous to this commit we were modifying the offset before
the array offset check. This was causing a spurious debug
message indicating the offset was out of bounds. An second
problem is that upon detecting the error we don't exit the loop.
A third problem was that when reading the offset the check
didn't cater for the size of the integer address about to be read.

This commit moves the offset check to before the first read,
additionally when an error is detected now we actually exit the loop
and the offset have been corrected to include the size of the
integer to be read

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15579
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sat Feb 17 17:58:43 UTC 2024 on atb-devel-224
source3/rpc_client/wsp_cli.c