Check input string in ps_clean_string().
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 26 Aug 2010 20:22:28 +0000 (20:22 +0000)
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 26 Aug 2010 20:22:28 +0000 (20:22 +0000)
This fixes bug 5148.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33941 f5534014-38df-0310-8fa8-9805f1628bb7

print.c

diff --git a/print.c b/print.c
index 0ef9e86d3392f81a3e631c23e520c273092ed8e1..d60cd473366cf8d9ef0356832d00beaeb985ddc3 100644 (file)
--- 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) {