Skip to contentSkip to conversation

tools: mkimage: fix sizeof_mismatch found by coverity

PATCH In review Sven Ebenfeld 2 participants 2 messages Jan 17, 2017 – Jan 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: mkimage: fix sizeof_mismatch found by coverity

Reported-by Coverity (CID: 155214)
---
 tools/mkimage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/mkimage.c +1 -1
index f48135f..e9d049e 100644
@@ -522,7 +522,7 @@ int main(int argc, char **argv)
 							+ 0x20, 0 };
 			int i = params.file_size;
 			for (; i < aligned_filesize; i++) {
-				if (write(ifd, &i, 1) != 1) {
+				if (write(ifd, (char *) &i, 1) != 1) {
 					fprintf(stderr,
 							"%s: Write error on %s: %s\n",
 							params.cmdname,
Signature · 1 line
2.7.4
#1 lore raw
Quoted 2 lines · Sven Ebenfeld
Reported-by Coverity (CID: 155214)

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/20170120/9c907c72/attachment.sig>