From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ItSq4-000257-Aw for qemu-devel@nongnu.org; Sat, 17 Nov 2007 13:56:20 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ItSq2-00024H-K0 for qemu-devel@nongnu.org; Sat, 17 Nov 2007 13:56:19 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ItSq2-00024C-Hb for qemu-devel@nongnu.org; Sat, 17 Nov 2007 13:56:18 -0500 Received: from atlas.informatik.uni-freiburg.de ([132.230.150.3]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ItSq2-0003G3-03 for qemu-devel@nongnu.org; Sat, 17 Nov 2007 13:56:18 -0500 Received: from mafia.informatik.uni-freiburg.de ([132.230.150.87]) by atlas.informatik.uni-freiburg.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1ItSq0-0004Sh-9S for qemu-devel@nongnu.org; Sat, 17 Nov 2007 19:56:16 +0100 Message-ID: <473F394D.1010902@gmx.net> Date: Sat, 17 Nov 2007 19:56:13 +0100 From: Thorsten Zitterell MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090700080401060701040403" Subject: [Qemu-devel] [PATCH] hw/pflash_cfi01.c Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------090700080401060701040403 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Patch to catch wrong/unknown command sequences. --------------090700080401060701040403 Content-Type: text/x-patch; name="qemu-pflash-default-catcher.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-pflash-default-catcher.patch" Index: hw/pflash_cfi01.c =================================================================== RCS file: /sources/qemu/qemu/hw/pflash_cfi01.c,v retrieving revision 1.2 diff -u -r1.2 pflash_cfi01.c --- hw/pflash_cfi01.c 17 Nov 2007 17:14:45 -0000 1.2 +++ hw/pflash_cfi01.c 17 Nov 2007 18:51:04 -0000 @@ -353,6 +353,8 @@ pfl->counter--; break; + default: + goto error_flash; } return; case 3: /* Confirm mode */ @@ -361,11 +363,14 @@ if (cmd == 0xd0) { pfl->wcycle = 0; pfl->status |= 0x80; - break; } else { DPRINTF("%s: unknown command for \"write block\"\n", __func__); PFLASH_BUG("Write block confirm"); + goto reset_flash; } + break; + default: + goto error_flash; } return; default: --------------090700080401060701040403--