summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/printf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/shared/printf.c b/src/shared/printf.c
index 2dc3048..ff07c72 100644
--- a/src/shared/printf.c
+++ b/src/shared/printf.c
@@ -171,6 +171,7 @@ int __printf_internal(const char *fmt, va_list argp,
static void vsnprintf_backend(void *arg, const char *buf, size_t len) {
char **ptrs = arg;
size_t space = ptrs[1] - ptrs[0];
+ if (!ptrs[0]) return;
if (len > space) len = space;
memcpy(ptrs[0], buf, len);