]> git.ipfire.org Git - thirdparty/samba.git/commit
s3:g_lock: Do not let pointers to point outside the input buffer
authorPavel Filipenský <pfilipensky@samba.org>
Fri, 4 Oct 2024 08:31:03 +0000 (10:31 +0200)
committerPavel Filipensky <pfilipensky@samba.org>
Sat, 5 Oct 2024 14:44:46 +0000 (14:44 +0000)
commitc75b08c0d6417792aba0027b67a29eda43f6b00d
treef0715c860fd007d76cae927fd6b776933c35c192
parent3766b6a126f659a43e2e36c66689c136fc22dbc4
s3:g_lock: Do not let pointers to point outside the input buffer

If num_shared == 0 the shared points at the address outside the buf.
Make it NULL instead.

(gdb) p *lck
$33 = {
  exclusive = {
    pid = 1187098,
    task_id = 0,
    vnn = 4294967295,
    unique_id = 7349874180613937639
  },
  num_shared = 0,
  shared = 0x555555646980 "@kdUUU",
  unique_lock_epoch = 1489043017590848833,
  unique_data_epoch = 11232048132975083808,
  datalen = 0,
  data = 0x555555646980 "@kdUUU"
}

Same for datalen & data.

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Sat Oct  5 14:44:46 UTC 2024 on atb-devel-224
source3/lib/g_lock.c