]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mtdparts: Fix uninitialized scalar usage
authorTom Rini <trini@konsulko.com>
Sat, 26 Aug 2017 20:59:24 +0000 (16:59 -0400)
committerTom Rini <trini@konsulko.com>
Sat, 26 Aug 2017 20:59:24 +0000 (16:59 -0400)
When reworking this code to fix other issues found by Coverity, I forgot
to ensure tmp_ep was always cleared before use.

Reported-by: Coverity (CID: 166612)
Fixes: bc028345acc4 ("mtdparts: Fix final outstanding issue reported by Coverity")
Signed-off-by: Tom Rini <trini@konsulko.com>
cmd/mtdparts.c

index 6e12275b4083fd3b7d33d762d243f4411abd02a1..3275eb919bfb2a561364570de2c8a2c6dd0212ea 100644 (file)
@@ -1751,6 +1751,7 @@ int mtdparts_init(void)
        /* save it for later parsing, cannot rely on current partition pointer
         * as 'partition' variable may be updated during init */
        memset(tmp_parts, 0, sizeof(tmp_parts));
+       memset(tmp_ep, 0, sizeof(tmp_ep));
        if (current_partition)
                strncpy(tmp_ep, current_partition, PARTITION_MAXLEN);