]> git.ipfire.org Git - thirdparty/knot-resolver.git/commit
lib/generic/pack: fix operations on empty pack
authorMarek Vavruša <mvavrusa@cloudflare.com>
Fri, 20 Apr 2018 03:15:19 +0000 (20:15 -0700)
committerMarek Vavruša <mvavrusa@cloudflare.com>
Fri, 7 Sep 2018 17:45:21 +0000 (10:45 -0700)
commitb7dbb94cadeba49430619ded9de9ea90dd92c906
tree4d0736fe5fcd3e1e9e58bc0fcddbb1547c1067fd
parent625bd47986b1abd1bf6cf8752e2fccfbbcb17767
lib/generic/pack: fix operations on empty pack

Several operations were not safe to call on empty pack and would
return invalid memory. If the pack would have reserved space, but
would be empty (length = 0), it's head would be NULL but tail would
be array address (pack->at + 0). This is mostly checked by caller,
but it wasn't in several places (object deletion).
lib/generic/pack.h