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


Reply via email to