summaryrefslogtreecommitdiff
path: root/src/backend/regex
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2015-05-18 10:02:31 -0400
committerNoah Misch <noah@leadboat.com>2015-05-18 10:02:35 -0400
commit2e3bd06654217adcf41878ba3517f31f0adf0ea6 (patch)
treed2506def67a96d0022142f33f64f6d48cd40ccef /src/backend/regex
parentf7c4fe7d95a3f323df3b0dc3bffff5fa9d708a0c (diff)
Add error-throwing wrappers for the printf family of functions.
All known standard library implementations of these functions can fail with ENOMEM. A caller neglecting to check for failure would experience missing output, information exposure, or a crash. Check return values within wrappers and code, currently just snprintf.c, that bypasses the wrappers. The wrappers do not return after an error, so their callers need not check. Back-patch to 9.0 (all supported versions). Popular free software standard library implementations do take pains to bypass malloc() in simple cases, but they risk ENOMEM for floating point numbers, positional arguments, large field widths, and large precisions. No specification demands such caution, so this commit regards every call to a printf family function as a potential threat. Injecting the wrappers implicitly is a compromise between patch scope and design goals. I would prefer to edit each call site to name a wrapper explicitly. libpq and the ECPG libraries would, ideally, convey errors to the caller rather than abort(). All that would be painfully invasive for a back-patched security fix, hence this compromise. Security: CVE-2015-3166
Diffstat (limited to 'src/backend/regex')
0 files changed, 0 insertions, 0 deletions