libdpkg: Compute string slice for varbuf_has_suffix() check on good values
commit7f287adcd0b7c09d9c212ecc38190fd0d393c0bc
authorGuillem Jover <guillem@debian.org>
Sun, 19 May 2024 12:12:58 +0000 (19 14:12 +0200)
committerGuillem Jover <guillem@debian.org>
Sun, 19 May 2024 16:19:57 +0000 (19 18:19 +0200)
tree2aaf07a5fef4537aea7694df31e105d2f68ca38c
parent61b221cf7bab32d62f43a1bcb2b9eb88a42d94c5
libdpkg: Compute string slice for varbuf_has_suffix() check on good values

We should not compute the slice with «used» members values that we know
will produce a wrong pointer, even if we do not end up using it, as that
can trip static analyzers.

Changelog: silent
lib/dpkg/varbuf.c