From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8qrz-0004rV-To for qemu-devel@nongnu.org; Tue, 04 Sep 2012 07:00:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8qrv-0002qD-RN for qemu-devel@nongnu.org; Tue, 04 Sep 2012 07:00:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8qrv-0002q6-J8 for qemu-devel@nongnu.org; Tue, 04 Sep 2012 07:00:31 -0400 Message-ID: <5045DF3E.9000808@redhat.com> Date: Tue, 04 Sep 2012 13:00:14 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1346703236-4280-1-git-send-email-sw@weilnetz.de> In-Reply-To: <1346703236-4280-1-git-send-email-sw@weilnetz.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] ide: Fix error messages from static code analysis (no real error) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: qemu-devel@nongnu.org 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 > --- > > 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