diff options
author | Andreas Schneider <asn@samba.org> | 2017-10-26 09:43:56 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2017-12-10 00:46:26 +0100 |
commit | b3d50723b00dfb7e1ee03eb1075e3341c8978fa2 (patch) | |
tree | fce64425f1c5daa0eba77d5c7ec7dbba7511d570 /source3 | |
parent | 53f7bbca0451e4f57cdbe8ab4f67f601fe8d40c1 (diff) | |
download | samba-b3d50723b00dfb7e1ee03eb1075e3341c8978fa2.tar.gz |
s3:glock: Move sanity check in g_lock_parse()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Dec 10 00:46:26 CET 2017 on sn-devel-144
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/g_lock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/lib/g_lock.c b/source3/lib/g_lock.c index c5d66e3855e..50ea56634ba 100644 --- a/source3/lib/g_lock.c +++ b/source3/lib/g_lock.c @@ -74,12 +74,12 @@ static bool g_lock_parse(uint8_t *buf, size_t buflen, struct g_lock *lck) found_recs = IVAL(buf, 0); + buf += sizeof(uint32_t); + buflen -= sizeof(uint32_t); if (found_recs > buflen/G_LOCK_REC_LENGTH) { return false; } - buf += sizeof(uint32_t); - buflen -= sizeof(uint32_t); data_ofs = found_recs * G_LOCK_REC_LENGTH; *lck = (struct g_lock) { |