]> git.ipfire.org Git - thirdparty/squid.git/commit
Use va_copy() on all platforms; fixed a dangerous low-level bug (#160)
authorAmos Jeffries <yadij@users.noreply.github.com>
Thu, 1 Mar 2018 23:48:28 +0000 (12:48 +1300)
committerGitHub <noreply@github.com>
Thu, 1 Mar 2018 23:48:28 +0000 (12:48 +1300)
commit9a03c44bb897241473997e57d33656add9f8ee71
treee7fd1c03278c6fbb941777525b4fe9378be9ad5f
parent3be0bfecd0e9eabff7a7c988f395ba32b7c1a130
Use va_copy() on all platforms; fixed a dangerous low-level bug (#160)

To improve cross-compilation support and to simplify code, rely on C++11
cstdarg header instead of ./configure-time va_copy() detection.

Using ./configure-time detection for va_copy() is dangerous because when
it does not work (e.g., during a poorly configured cross-compilation
attempt), Squid may crash if va_copy() was needed but was not detected.

See also: Bug 4821 and bug 753.

Also found and fixed a low-level bug: StoreEntry::vappendf() was not
using va_copy() because store.cc lacked VA_COPY #defines. The affected
code (900+ callers!) is used for cache manager responses and Gopher
gateway response compilation. If any of those calls required a buffer
larger than 4KB, the lack of those va_copy() calls could lead to crashes
and/or data corruption issues on platforms where va_copy() is required.
acinclude/os-deps.m4
configure.ac
src/MemBuf.cc
src/MemStore.cc
src/acl/external/eDirectory_userip/ext_edirectory_userip_acl.cc
src/acl/external/time_quota/ext_time_quota_acl.cc
src/sbuf/SBuf.cc
src/sbuf/SBuf.h
src/store.cc