Skip to contentSkip to conversation

mtdparts: Fix uninitialized scalar usage

PATCH New Tom Rini 1 participant 2 messages Aug 26, 2017

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 mtdparts: Fix uninitialized scalar usage

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")
---
 cmd/mtdparts.c | 1 +
 1 file changed, 1 insertion(+)
cmd/mtdparts.c +1 -0
index 6e12275b4083..3275eb919bfb 100644
@@ -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);
 
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/1 mtdparts: Fix uninitialized scalar usage

Quoted 6 lines · Tom Rini

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")

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170826/5c6b6091/attachment.sig>