From 0da10ea490b1faeb08d3b58fb3f8826c3c50d903 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 30 Oct 2015 14:41:52 +0100 Subject: [PATCH] CID 22513: Out-of-bounds read (OVERRUN) --- src/spells.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/spells.c b/src/spells.c index abb938780..9498a5a1f 100644 --- a/src/spells.c +++ b/src/spells.c @@ -571,11 +571,12 @@ static int sp_summon_familiar(castorder * co) region *rn = rconnect(r, dir); if (rn && fval(rn->terrain, SEA_REGION)) { dh++; - if (dh == coasts) + if (dh == coasts) { + r = rconnect(r, dir); break; + } } } - r = rconnect(r, dir); } msg = msg_message("familiar_name", "unit", mage);