summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libudev/libudev.c2
-rw-r--r--src/udev/udev-rules.c2
2 files changed, 2 insertions, 2 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;
}
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index f6c416bf70..d88687e9c2 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -614,7 +614,7 @@ static int import_property_from_string(struct udev_device *dev, char *line) {
/* 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;
}