libudev: accept NULL whitelist in util_replace_chars()

This commit is contained in:
Kay Sievers
2008-11-20 02:43:34 +01:00
parent 24239ded2d
commit bbfaec2b2f

View 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++;