replay_configure() pushes and pops a Location with automatic storage
duration. Except it fails to pop when -icount parameter "rr" isn't
given. cur_loc then points to unused stack space, and will most
likely get clobbered in short order.
Clobbered cur_loc can make loc_pop() and error_print_loc() crash or
report bogus locations.
Broken in commit
890ad55.
I didn't take the time to find a reproducer.
Cc: Eduardo Habkost <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
Message-Id: <
1461767349[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Eduardo Habkost <[email protected]>
rr = qemu_opt_get(opts, "rr");
if (!rr) {
/* Just enabling icount */
- return;
+ goto out;
} else if (!strcmp(rr, "record")) {
mode = REPLAY_MODE_RECORD;
} else if (!strcmp(rr, "replay")) {
replay_enable(fname, mode);
+out:
loc_pop(&loc);
}