mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
s3/lib/dwrap: clang: Fix 'Array access results in a null pointer dereference'
Fixes: source3/lib/dbwrap/dbwrap_watch.c:55:3: warning: Array access (from variable 'wkey') results in a null pointer dereference <--[clang] SIVAL(wkey, 0, db_id_len); ^ 1 warning generated. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
This commit is contained in:
parent
57e9b358ec
commit
0ca6d34a69
@ -51,7 +51,7 @@ static ssize_t dbwrap_record_watchers_key(struct db_context *db,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (wkey_len >= needed) {
|
||||
if (wkey != NULL && wkey_len >= needed) {
|
||||
SIVAL(wkey, 0, db_id_len);
|
||||
memcpy(wkey + sizeof(uint32_t), db_id, db_id_len);
|
||||
memcpy(wkey + sizeof(uint32_t) + db_id_len,
|
||||
|
Loading…
x
Reference in New Issue
Block a user