From 76179ea0ba30554dbc521bc3c770dd68a5e8daf7 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 1 Jan 2024 10:55:14 -0500 Subject: [PATCH] assert that u.ulevel is in range for use as index Resolves #1189 --- src/exper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/exper.c b/src/exper.c index 1548c98d0..597683f5b 100644 --- a/src/exper.c +++ b/src/exper.c @@ -240,6 +240,8 @@ losexp( livelog_printf(LL_MINORAC, "lost all experience"); } + assert(u.ulevel >= 0 && u.ulevel < MAXULEV); + olduhpmax = u.uhpmax; uhpmin = minuhpmax(10); /* same minimum as is used by life-saving */ num = (int) u.uhpinc[u.ulevel];