From 9dcd08e585d6670f07a0328607961daa552eb6e1 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Sun, 13 Jul 2025 10:26:09 -0700 Subject: [PATCH] 53820: detect integer overflow when parsing history word designators. --- hist.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Src/hist.c b/Src/hist.c index 00bdbb2b87..4e4a20e31a 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -1800,6 +1800,11 @@ getargspec(int argc, int marg, int evset) ret = 0; while (idigit(c)) { ret = ret * 10 + c - '0'; + if (ret < 0) { + herrflush(); + zerr("no such word in event"); + return -2; + } c = ingetc(); } inungetc(c);