|
From: | Markus Armbruster |
Subject: | Re: [Qemu-devel] [PATCH 03/11] eepro100: initialize a variable in all cases |
Date: | Thu, 07 Oct 2010 11:31:16 +0200 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Blue Swirl <address@hidden> writes: > Compiling with GCC 4.6.0 20100925 produced warnings: > /src/qemu/hw/eepro100.c: In function 'eepro100_read4': > /src/qemu/hw/eepro100.c:1351:14: error: 'val' may be used > uninitialized in this function [-Werror=uninitialized] > /src/qemu/hw/eepro100.c: In function 'eepro100_read2': > /src/qemu/hw/eepro100.c:1328:14: error: 'val' may be used > uninitialized in this function [-Werror=uninitialized] > /src/qemu/hw/eepro100.c: In function 'eepro100_read1': > /src/qemu/hw/eepro100.c:1285:13: error: 'val' may be used > uninitialized in this function [-Werror=uninitialized] > > Fix by initializing 'val' at start. I'm worried this sweeps bugs under the carpet. When addr is out of bounds, these function return garbage. Your patch makes them return 0 instead. Can that happen? Shouldn't we catch and flag it?
[Prev in Thread] | Current Thread | [Next in Thread] |