vsprintf: Handle NULL with %pU
authorSimon Glass <sjg@chromium.org>
Mon, 18 Jun 2018 14:08:20 +0000 (08:08 -0600)
committerAlexander Graf <agraf@suse.de>
Wed, 25 Jul 2018 12:57:44 +0000 (14:57 +0200)
commitd7ae1609a9d5a76235978e34de0e9928979af781
treeb367e3de78e421c8e682b0629d70c310e7f806a6
parent282a06cbcae84acd86125210dbd54a10ff41e809
vsprintf: Handle NULL with %pU

At present a NULL pointer passed to printf for a %pU argument will cause
U-Boot to access memory at 0. Fix this by adding a check, and print
"(null)" instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexander Graf <agraf@suse.de>
[agraf: s/(null)/<NULL>/]
Signed-off-by: Alexander Graf <agraf@suse.de>
lib/vsprintf.c