]> granicus.if.org Git - nethack/commit
fix a segfault in mapglyph reported by Pasi earlier today
authornhmall <mjnh@persona.ca>
Tue, 10 Mar 2015 01:08:26 +0000 (21:08 -0400)
committernhmall <mjnh@persona.ca>
Tue, 10 Mar 2015 01:08:26 +0000 (21:08 -0400)
commitfa04eff2821fe4c9f9c6587bf85160f57c8d7203
tree9acb57e617569a0921f20ccbc3d71ba2619f01fb
parent8c048e60861d41a6da6b12378556af18fa36fe09
fix a segfault in mapglyph reported by Pasi earlier today
 Changes to be committed:
modified:   src/pager.c

Steps to reproduce the reported segfault:
Use / command, answer n, press space and enter

In do_look() variable glyph is only set to a proper
value if using the screen (from_screen) or the
mouse (clicklook).

On the code path that triggered the segfault,
glyph was being passed to mapglyph with a random
arbitrary value.

If glyph had been initialized at the start of
do_look(), it would have prevented the segfault,
but would have always displayed a giant ant or
something silly instead of the correct thing.

Don't use glyph except under
from_screen || clicklook.
src/pager.c