OSDN Git Service

replay: Fix dangling location bug in replay_configure()
authorMarkus Armbruster <armbru@redhat.com>
Wed, 27 Apr 2016 14:29:08 +0000 (16:29 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 28 Apr 2016 06:19:20 +0000 (08:19 +0200)
commitd9d3aaea0b3fbb5028e20316bdb93359487cd01f
tree694e1415d48f74546d9a2a925100040882ff1b56
parent37f32349ea43f41ee8b9a253977ce1e46f576fc7
replay: Fix dangling location bug in replay_configure()

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 <ehabkost@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1461767349-15329-3-git-send-email-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
replay/replay.c