From: Kay Sievers Date: Thu, 20 Nov 2008 01:43:34 +0000 (+0100) Subject: libudev: accept NULL whitelist in util_replace_chars() X-Git-Tag: 174~1300 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbfaec2b2f43ddf7b8ef42a2a687f536ac445183;p=systemd libudev: accept NULL whitelist in util_replace_chars() --- diff --git a/udev/lib/libudev-util.c b/udev/lib/libudev-util.c index f4e78850..1cd18c89 100644 --- a/udev/lib/libudev-util.c +++ b/udev/lib/libudev-util.c @@ -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++;