[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [PATCH v2] vt82c686: fix coverity warning about out-o
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-trivial] [PATCH v2] vt82c686: fix coverity warning about out-of-bounds write |
Date: |
Wed, 10 Dec 2014 10:14:46 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
On 10/12/2014 09:57, Michael Tokarev wrote:
> 09.12.2014 10:15, zhanghailiang wrote:
>> Refactor superio_ioport_writeb to fix the out of bounds write warning.
>
> Is it just a warning, or real oob write?
> From the code it looks like it's just a warning...
It's a bug.
The simpler patch would have been just to remove the useless assignment
superio_conf->config[superio_conf->index] = data & 0xff;
that is *outside* the switch and not protected by if (can_write). Apart
from this, there is an off-by-one that I'll send a patch for right away.
Paolo
>
> []
>> +
>> + }
>> + if (can_write == true) {
>
> 09.12.2014 17:08, Paolo Bonzini wrote:
>> Michael, can you remove "== true" when applying this patch?
>
> Sure, just did. Does it mean I can add your R-b too? ;)
Sure.
Paolo