Shao Miller
2009-Dec-09 06:52 UTC
[syslinux] [PATCH] memdisk: Fix "might be used uninitialized" warnings
From 43e0635d7d90f65055d1f49d998974041315f4fc Mon Sep 17 00:00:00 2001 From: Shao Miller <shao.miller at yrdsb.edu.on.ca> Date: Fri, 11 Dec 2009 01:26:59 +0000 Subject: [PATCH] memdisk: Fix "might be used uninitialized" warnings The checksum_buf function was providing an incorrect checksum on at least one build. Signed-off-by: Shao Miller <shao.miller at yrdsb.edu.on.ca> --- memdisk/setup.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/memdisk/setup.c b/memdisk/setup.c index ea17afd..b8eadfb 100644 --- a/memdisk/setup.c +++ b/memdisk/setup.c @@ -592,7 +592,7 @@ static const struct geometry *get_disk_image_geometry(uint32_t where, while (!ok) { /* Assume it's a floppy drive, guess a geometry */ unsigned int type, track; - int c, h, s; + int c, h, s = 0; if (xsectors < 320 * 2) { c = 40; @@ -795,7 +795,7 @@ static void relocate_rm_code(uint32_t newbase) static uint8_t checksum_buf(const void *buf, int count) { const uint8_t *p = buf; - uint8_t c; + uint8_t c = 0; while (count--) c += *p++; -- 1.5.3.4 - Shao Miller -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: 0001-memdisk-Fix-might-be-used-uninitialized-warnings.patch URL: <http://www.zytor.com/pipermail/syslinux/attachments/20091209/69a6a734/attachment.ksh>
Shao Miller
2009-Dec-11 01:26 UTC
[PATCH] memdisk: Fix "might be used uninitialized" warnings
The checksum_buf function was providing an incorrect checksum on at least one build. Signed-off-by: Shao Miller <shao.miller at yrdsb.edu.on.ca> --- memdisk/setup.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/memdisk/setup.c b/memdisk/setup.c index ea17afd..b8eadfb 100644 --- a/memdisk/setup.c +++ b/memdisk/setup.c @@ -592,7 +592,7 @@ static const struct geometry *get_disk_image_geometry(uint32_t where, while (!ok) { /* Assume it''s a floppy drive, guess a geometry */ unsigned int type, track; - int c, h, s; + int c, h, s = 0; if (xsectors < 320 * 2) { c = 40; @@ -795,7 +795,7 @@ static void relocate_rm_code(uint32_t newbase) static uint8_t checksum_buf(const void *buf, int count) { const uint8_t *p = buf; - uint8_t c; + uint8_t c = 0; while (count--) c += *p++; -- 1.5.3.4 --------------090404070504060403030208--
Possibly Parallel Threads
- [PATCH] memdisk: "safe hook" and mBFT
- [PATCH] nv50/ir: rebase indirect temp arrays to 0, so that we use less lmem space
- SYSLINUX 2.10-pre6 is now release candidate
- [PATCH] memdisk: Use boot_lba logic for booting an offset within the di
- [PATCH] Let MEMDISK honor the quiet append option