summaryrefslogtreecommitdiff
path: root/src/libudev/libudev.c
diff options
context:
space:
mode:
authorTobias Stoeckmann <stoeckmann@users.noreply.github.com>2016-12-02 00:46:36 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-12-01 18:46:36 -0500
commitcd05bb8bafa808f0a40feaaa0e8cc564c0f203a7 (patch)
tree952854e97d7a5b86bb566a2684b5f0efe3ccf7ee /src/libudev/libudev.c
parent7e3f4e7f3d7e28c4063dc1e6d2e4502ca952b72b (diff)
downloadsystemd-cd05bb8bafa808f0a40feaaa0e8cc564c0f203a7.tar.gz
Spot inconsistent quoting (just one single quote) (#4732)
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.
Diffstat (limited to 'src/libudev/libudev.c')
-rw-r--r--src/libudev/libudev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libudev/libudev.c b/src/libudev/libudev.c
index 63fb05547d..57ce749e07 100644
--- a/src/libudev/libudev.c
+++ b/src/libudev/libudev.c
@@ -156,7 +156,7 @@ _public_ struct udev *udev_new(void) {
/* 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;
}