s3/rpc_client: Fix array offset check
authorNoel Power <noel.power@suse.com>
Thu, 8 Feb 2024 14:05:43 +0000 (14:05 +0000)
committerJule Anger <janger@samba.org>
Mon, 26 Feb 2024 10:37:37 +0000 (10:37 +0000)
commit253c5585c91172ebe5cca9ca59ff30a82fbf3fd3
tree1a7350aa90d321172491699b8ab75f2db20164fd
parent1ab3de6f46e61281348f9275e0ae490b53591845
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

(cherry picked from commit 885850b6aaabf089f422b1b015481a0ccff4f90e)

Autobuild-User(v4-20-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-20-test): Mon Feb 26 10:37:37 UTC 2024 on atb-devel-224
source3/rpc_client/wsp_cli.c