chiark / gitweb /
libudev: accept NULL whitelist in util_replace_chars()
authorKay Sievers <kay.sievers@vrfy.org>
Thu, 20 Nov 2008 01:43:34 +0000 (02:43 +0100)
committerKay Sievers <kay.sievers@vrfy.org>
Thu, 20 Nov 2008 01:43:34 +0000 (02:43 +0100)
udev/lib/libudev-util.c

index f4e78850f9315ea17924f7bbb6c872c218eb3f2f..1cd18c890696968e8684dc0610486174b5277210 100644 (file)
@@ -398,7 +398,7 @@ int udev_util_replace_chars(char *str, const char *white)
                }
 
                /* if space is allowed, replace whitespace with ordinary space */
-               if (isspace(str[i]) && strchr(white, ' ') != NULL) {
+               if (isspace(str[i]) && white != NULL && strchr(white, ' ') != NULL) {
                        str[i] = ' ';
                        i++;
                        replaced++;