From 5af775ba8799e323b04353323afcdbe76a049e7d Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 6 May 2018 16:35:23 +0200 Subject: [PATCH] prevent out-of-bounds read. --- src/magic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/magic.c b/src/magic.c index a8190dfa8..80f528de8 100644 --- a/src/magic.c +++ b/src/magic.c @@ -1943,7 +1943,9 @@ static spellparameter *add_spellparameter(region * target_r, unit * u, break; case 'r': /* Parameter sind zwei Regionskoordinaten innerhalb der "normalen" Plane */ - j = addparam_region(param + i, &spobj, u, ord); + if (i + 1 < size) { + j = addparam_region(param + i, &spobj, u, ord); + } ++c; break; case 'b':