From patchwork Thu Nov 10 12:36:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 124876 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3B46DB6F7F for ; Fri, 11 Nov 2011 00:35:11 +1100 (EST) Received: from localhost ([::1]:59143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROTsj-0004kC-5p for incoming@patchwork.ozlabs.org; Thu, 10 Nov 2011 07:37:25 -0500 Received: from eggs.gnu.org ([140.186.70.92]:47439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROTsG-0003gT-GF for qemu-devel@nongnu.org; Thu, 10 Nov 2011 07:37:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROTsF-0005v1-8Q for qemu-devel@nongnu.org; Thu, 10 Nov 2011 07:36:56 -0500 Received: from mtagate7.uk.ibm.com ([194.196.100.167]:60724) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROTsF-0005uq-04 for qemu-devel@nongnu.org; Thu, 10 Nov 2011 07:36:55 -0500 Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id pAACarHN027829 for ; Thu, 10 Nov 2011 12:36:53 GMT Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pAACartt2359440 for ; Thu, 10 Nov 2011 12:36:53 GMT Received: from d06av01.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pAACapWw023725 for ; Thu, 10 Nov 2011 05:36:51 -0700 Received: from localhost (stefanha-thinkpad.manchester-maybrook.uk.ibm.com [9.174.219.31]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id pAACap34023718; Thu, 10 Nov 2011 05:36:51 -0700 From: Stefan Hajnoczi To: Date: Thu, 10 Nov 2011 12:36:44 +0000 Message-Id: <1320928604-6642-9-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.7.1 In-Reply-To: <1320928604-6642-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1320928604-6642-1-git-send-email-stefanha@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 194.196.100.167 Cc: Peter Maydell , Anthony Liguori , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 8/8] hw/lan9118.c: Add missing 'break' to fix buffer overrun X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Peter Maydell 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 Signed-off-by: Stefan Hajnoczi --- 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;