Fix issues detected by static analysis tool 11/304411/3 accepted/tizen_unified_riscv accepted/tizen/unified/20240117.163252 accepted/tizen/unified/riscv/20240118.054542
authorJihoon Kim <jihoon48.kim@samsung.com>
Wed, 17 Jan 2024 04:28:50 +0000 (13:28 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Wed, 17 Jan 2024 04:50:19 +0000 (13:50 +0900)
Change-Id: I91bedb9b89b4c6238f5c8b146ad7aa06e372d40d
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/filter.c
src/quirks.c

index 4c28bd9dd5229d77b3b8ecbdb0decc266cee85ee..1de7ce4451c3f6a60bd3f55c83f02991dcc1713a 100644 (file)
@@ -82,6 +82,9 @@ bool
 filter_set_speed(struct motion_filter *filter,
                 double speed_adjustment)
 {
+       if (!filter || !filter->interface || !filter->interface->set_speed)
+               return false;
+
        return filter->interface->set_speed(filter, speed_adjustment);
 }
 
index 0fbd53f27caf266e95e1750062401e7960e84bcf..e016bff31cbafee376783ff6aa9a31c93fad6f1c 100644 (file)
@@ -922,7 +922,7 @@ parse_file(struct quirks_context *ctx, const char *path)
                STATE_ANY,
        };
        FILE *fp;
-       char line[512];
+       char line[512] = {0,};
        bool rc = false;
        enum state state = STATE_SECTION;
        struct section *section = NULL;