[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] ide: Fix error messages from static code analys
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH] ide: Fix error messages from static code analysis (no real error) |
Date: |
Tue, 04 Sep 2012 13:00:14 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 |
Am 03.09.2012 22:13, schrieb Stefan Weil:
> Report from smatch:
> hw/ide/core.c:1472 ide_exec_cmd(423) error: buffer overflow
> 'smart_attributes' 8 <= 29
> hw/ide/core.c:1474 ide_exec_cmd(425) error: buffer overflow
> 'smart_attributes' 8 <= 29
> hw/ide/core.c:1475 ide_exec_cmd(426) error: buffer overflow
> 'smart_attributes' 8 <= 29
> ...
>
> The upper limit of 30 was never reached because both for loops terminated
> when 'smart_attributes' reached end of list, so there was no real buffer
> overflow.
>
> Nevertheless, changing the code not only fixes the error report, but also
> reduces the size of smart_attributes and simplifies the for loops.
>
> Signed-off-by: Stefan Weil <address@hidden>
> ---
>
> Note: scripts/checkpatch.pl reports warnings and errors caused by tabs and
> wrong indentation. I did not fix that because the whole file is full of tabs.
>
> - sw
Thanks, applied to block-next.
Kevin