aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--print.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/print.c b/print.c
index 0ef9e86d33..d60cd47336 100644
--- a/print.c
+++ b/print.c
@@ -939,6 +939,11 @@ void ps_clean_string(unsigned char *out, const unsigned char *in,
int rd, wr;
char c;
+ if (in == NULL) {
+ out[0] = '\0';
+ return;
+ }
+
for (rd = 0, wr = 0 ; wr < outbuf_size; rd++, wr++ ) {
c = in[rd];
switch (c) {