It is possible to specify only one quote in udev rules, which is not
detected as an invalid quoting (" instead of "" for empty string).
Technically this doesn't lead to a bug, because the string ends in two
terminating nul characters at this position, but a user should still be
reminded that his configuration is invalid.
/* unquote */
if (val[0] == '"' || val[0] == '\'') {
- if (val[len-1] != val[0]) {
+ if (len == 1 || val[len-1] != val[0]) {
log_debug("/etc/udev/udev.conf:%u: inconsistent quoting, skipping line.", line_nr);
continue;
}
/* unquote */
if (val[0] == '"' || val[0] == '\'') {
- if (val[len-1] != val[0]) {
+ if (len == 1 || val[len-1] != val[0]) {
log_debug("inconsistent quoting: '%s', skip", line);
return -1;
}