aboutsummaryrefslogtreecommitdiffstats
path: root/print.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2010-08-26 20:22:28 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2010-08-26 20:22:28 +0000
commit6d5dfbffb30adc442c9e0d03a3b0db1af56d6827 (patch)
tree0231aa2c0a519df011f6903c187b16317fa77341 /print.c
parent63fc078fed67856c3a25a898616039cfd0981645 (diff)
Check input string in ps_clean_string().
This fixes bug 5148. svn path=/trunk/; revision=33941
Diffstat (limited to 'print.c')
-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) {