From patchwork Wed Nov 9 18:59:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 4985 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2013323E0D for ; Wed, 9 Nov 2011 18:59:59 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 0558FA18896 for ; Wed, 9 Nov 2011 18:59:59 +0000 (UTC) Received: by faan26 with SMTP id n26so2829881faa.11 for ; Wed, 09 Nov 2011 10:59:58 -0800 (PST) Received: by 10.152.144.202 with SMTP id so10mr2477184lab.9.1320865198429; Wed, 09 Nov 2011 10:59:58 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.10.72 with SMTP id g8cs182865lab; Wed, 9 Nov 2011 10:59:58 -0800 (PST) Received: by 10.181.11.226 with SMTP id el2mr4131989wid.64.1320865196535; Wed, 09 Nov 2011 10:59:56 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id p66si3274218weq.67.2011.11.09.10.59.56 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Nov 2011 10:59:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1RODNK-0002YA-Ko; Wed, 09 Nov 2011 18:59:54 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, qemu-trivial@nongnu.org Subject: [PATCH] hw/lan9118.c: Add missing 'break' to fix buffer overrun Date: Wed, 9 Nov 2011 18:59:54 +0000 Message-Id: <1320865194-9779-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 Add a missing 'break' statement to fix a buffer overrun when executing the EEPROM write-all command. Spotted by Coverity (see bug 887883). Signed-off-by: Peter Maydell --- hw/lan9118.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/lan9118.c b/hw/lan9118.c index 634b88e..f8149e6 100644 --- a/hw/lan9118.c +++ b/hw/lan9118.c @@ -863,6 +863,7 @@ static void lan9118_eeprom_cmd(lan9118_state *s, int cmd, int addr) } else { DPRINTF("EEPROM Write All (ignored)\n"); } + break; case 5: /* ERASE */ if (s->eeprom_writable) { s->eeprom[addr] = 0xff;