summaryrefslogtreecommitdiff
path: root/lib/variables.c
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2019-02-12 18:04:49 -0500
committerPeter Jones <pjones@redhat.com>2020-07-23 20:52:12 -0400
commit344a8364cb05cdaafc43231d0f73d5217c4e118c (patch)
tree29ed55873cf9fcb0e3501319716d3318b20ed303 /lib/variables.c
parent95bd1d88003a9a7c2732472b061ad2a9c7140419 (diff)
downloadefi-boot-shim-344a8364cb05cdaafc43231d0f73d5217c4e118c.tar.gz
efi-boot-shim-344a8364cb05cdaafc43231d0f73d5217c4e118c.zip
VLogError(): Avoid NULL pointer dereferences in (V)Sprint calls
VLogError() calculates the size of format strings by using calls to SPrint and VSPrint with a StrSize of 0 and NULL for an output buffer. Unfortunately, this is an incorrect usage of (V)Sprint. A StrSize of "0" is special-cased to mean "there is no limit". So, we end up writing our string to address 0x0. This was discovered because it causes a crash on ARM where, unlike x86, it does not necessarily have memory mapped at 0x0. Avoid the (V)Sprint calls altogether by using (V)PoolPrint, which handles the size calculation and allocation for us. Signed-off-by: Peter Jones <pjones@redhat.com> Fixes: 25f6fd08cd26 ("try to show errors more usefully.") [dannf: commit message ] Signed-off-by: dann frazier <dann.frazier@canonical.com> Upstream-commit-id: 20e731f423a
Diffstat (limited to 'lib/variables.c')
0 files changed, 0 insertions, 0 deletions