summaryrefslogtreecommitdiffstats
path: root/src/core/vsprintf.c
diff options
context:
space:
mode:
authorMichael Brown2006-12-19 23:33:42 +0100
committerMichael Brown2006-12-19 23:33:42 +0100
commit19e1d674d301b5db97462f005cb1d57d99ff9797 (patch)
tree7f872e58426db3095b721297a52a6c407386138a /src/core/vsprintf.c
parentStart of generic editable string support (diff)
downloadipxe-19e1d674d301b5db97462f005cb1d57d99ff9797.tar.gz
ipxe-19e1d674d301b5db97462f005cb1d57d99ff9797.tar.xz
ipxe-19e1d674d301b5db97462f005cb1d57d99ff9797.zip
Catch attempts to print NULL strings
Diffstat (limited to 'src/core/vsprintf.c')
-rw-r--r--src/core/vsprintf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/vsprintf.c b/src/core/vsprintf.c
index 42bd510b..e225d48c 100644
--- a/src/core/vsprintf.c
+++ b/src/core/vsprintf.c
@@ -219,6 +219,8 @@ size_t vcprintf ( struct printf_context *ctx, const char *fmt, va_list args ) {
cputchar ( ctx, va_arg ( args, unsigned int ) );
} else if ( *fmt == 's' ) {
ptr = va_arg ( args, char * );
+ if ( ! ptr )
+ ptr = "<NULL>";
} else if ( *fmt == 'p' ) {
intptr_t ptrval;