]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
m25p80.c: Return state to IDLE after COLLECTING
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Sat, 26 Jan 2013 01:58:38 +0000 (17:58 -0800)
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>
Sun, 27 Jan 2013 00:00:19 +0000 (01:00 +0100)
Default to moving back to the IDLE state after the COLLECTING_DATA
state. For a well behaved guest this patch has no consequence, but
A bad guest could crash QEMU by using one of the erase commands
followed by a longer than 5 byte argument (undefined behaviour).

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
hw/m25p80.c

index d39265632bb50cc09a8d18d0e0ffc24a006d236f..788c19608c191619594e4c615453089160212b0a 100644 (file)
@@ -358,6 +358,8 @@ static void complete_collecting_data(Flash *s)
     s->cur_addr |= s->data[1] << 8;
     s->cur_addr |= s->data[2];
 
+    s->state = STATE_IDLE;
+
     switch (s->cmd_in_progress) {
     case DPP:
     case QPP: