VLogError(): Avoid NULL pointer dereferences in (V)Sprint calls
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 <2e0a021e603479ff81838c00c3b770daca4e0214@redhat.com>
Fixes: 25f6fd08cd26 ("try to show errors more usefully.")
[dannf: commit message ]
Signed-off-by: dann frazier <ee1c4c8831cdb0850670d0d19969c9ba448b7200@canonical.com>
Upstream-commit-id: 20e731f423a

rhinstaller/shim,rhinstaller/shim,rhinstaller/shim