]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 5119: Null pointer dereference in makeMemNodeDataOffset() (#1623)
authorBen Kallus <49924171+kenballus@users.noreply.github.com>
Mon, 18 Dec 2023 18:43:03 +0000 (18:43 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 24 Dec 2023 17:07:36 +0000 (17:07 +0000)
commitabcbf879fc8970d0a9a929fe43667362b5f4be6d
treec299b097d300fbae8c5705e424c0438de5e790b4
parent1a848e4ef8ecf2da8887ec57f42cdcdc56eb40eb
Bug 5119: Null pointer dereference in makeMemNodeDataOffset() (#1623)

    UndefinedBehaviorSanitizer: undefined-behavior mem_node.cc:27:26 in
    runtime error: member access within null pointer of type 'mem_node'

Since only the address of the data member is computed, a compiler is
likely to perform pointer arithmetic rather than dereference a nullptr,
but it is best to replace this UB with a safe and clearer alternative.
src/mem_node.cc