quirks.c: Fix a coverity warning of potential NULL dereferences tizen_work_20220207 accepted/tizen/unified/20220214.131011 submit/tizen/20220211.064101
authorDuna Oh <duna.oh@samsung.com>
Fri, 11 Feb 2022 05:03:56 +0000 (14:03 +0900)
committerDuna Oh <duna.oh@samsung.com>
Fri, 11 Feb 2022 05:03:56 +0000 (14:03 +0900)
src/quirks.c

index fb49c29a27a4958b006e9b5d607ef5e31fc81e28..56214b574491e869d23fc85841d53157b70dcf16 100644 (file)
@@ -813,7 +813,7 @@ parse_value_line(struct quirks_context *ctx, struct section *s, const char *line
        bool rc = false;
 
        strv = strv_from_string(line, "=");
-       if (strv[0] == NULL || strv[1] == NULL || strv[2] != NULL) {
+       if (!strv || strv[0] == NULL || strv[1] == NULL || strv[2] != NULL) {
                goto out;
        }