* [Qemu-devel] [PATCH] sm501: Fix size of color_reg
@ 2012-01-04 21:50 Stefan Weil
2012-01-07 20:29 ` Aurelien Jarno
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Weil @ 2012-01-04 21:50 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Weil, Shin-ichiro Kawasaki
color_reg is expected to hold 32 bit values, so it was too small.
This bug was reported by coverity:
hw/sm501.c:624:
result_independent_of_operands:
color_reg >> 16 is 0 regardless of the values of its operands.
This occurs as the bitwise first operand of '&'.
Cc: Shin-ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
hw/sm501.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/hw/sm501.c b/hw/sm501.c
index 326531c..09c5894 100644
--- a/hw/sm501.c
+++ b/hw/sm501.c
@@ -593,7 +593,7 @@ static inline uint32_t get_hwc_x(SM501State *state, int crt)
*/
static inline uint16_t get_hwc_color(SM501State *state, int crt, int index)
{
- uint16_t color_reg = 0;
+ uint32_t color_reg = 0;
uint16_t color_565 = 0;
if (index == 0) {
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] sm501: Fix size of color_reg
2012-01-04 21:50 [Qemu-devel] [PATCH] sm501: Fix size of color_reg Stefan Weil
@ 2012-01-07 20:29 ` Aurelien Jarno
0 siblings, 0 replies; 2+ messages in thread
From: Aurelien Jarno @ 2012-01-07 20:29 UTC (permalink / raw)
To: Stefan Weil; +Cc: Shin-ichiro Kawasaki, qemu-devel
On Wed, Jan 04, 2012 at 10:50:09PM +0100, Stefan Weil wrote:
> color_reg is expected to hold 32 bit values, so it was too small.
>
> This bug was reported by coverity:
>
> hw/sm501.c:624:
> result_independent_of_operands:
> color_reg >> 16 is 0 regardless of the values of its operands.
> This occurs as the bitwise first operand of '&'.
>
> Cc: Shin-ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
> hw/sm501.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
Thanks, applied.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-01-07 20:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-04 21:50 [Qemu-devel] [PATCH] sm501: Fix size of color_reg Stefan Weil
2012-01-07 20:29 ` Aurelien Jarno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).