From 9e438662873c5b74baefce84f2da4a018e3b9d3f Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Fri, 13 Nov 2009 21:34:59 -0500 Subject: Fix a crash when _passive_freeze is called with NULL aux ouch can get called with a NULL aux parameter (for example by splash_with_acid), passing that null pointer to _passive_freeze was causing a crash. --- crawl-ref/source/ouch.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crawl-ref/source/ouch.cc') diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index a0d001fd3c..06f8eb2d09 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -869,7 +869,7 @@ static void _yred_mirrors_injury(int dam, int death_source) static void _passive_freeze(kill_method_type death_type, const char *aux, int death_source) { - const char *ptr = strstr(aux, "torment"); + const char *ptr = aux ? strstr(aux, "torment") : NULL; if (you.mutation[MUT_PASSIVE_FREEZE] && death_type == KILLED_BY_MONSTER && ptr == NULL) { -- cgit v1.2.3-54-g00ecf