]> git.ipfire.org Git - thirdparty/squid.git/commit
Fix type mismatch in new/delete of addrinfo::ai_addr (#2136) auto master
authorBen Kallus <49924171+kenballus@users.noreply.github.com>
Mon, 11 Aug 2025 13:02:17 +0000 (13:02 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 14 Aug 2025 02:50:45 +0000 (02:50 +0000)
commit5750e4fc76b55f7bc27ae8b8953e491991a91e55
tree99f840dace67384aa59113d4809ec498eaaa8908
parent86718fd74ebbd9e89e37fd6ba28f1c49fdb34b39
Fix type mismatch in new/delete of addrinfo::ai_addr (#2136)

new/delete type mismatches are UB. Fix an instance of this
problem that occurs when sockaddr_in6 is allocated, but
sockaddr is deallocated, by always allocating/deallocating
sockaddr_storage.

    AddressSanitizer: new-delete-type-mismatch:
      object passed to delete has wrong type:
      size of the allocated type:   28 bytes;
      size of the deallocated type: 16 bytes.
    #0 0xaaaad1a8db54 in operator delete(void*, unsigned long)
    #1 0xaaaad287a668 in Ip::Address::FreeAddr(addrinfo*&)
        src/ip/Address.cc:710:22
src/ip/Address.cc