From 9dcd08e585d6670f07a0328607961daa552eb6e1 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Sun, 13 Jul 2025 10:26:09 -0700 Subject: 53820: detect integer overflow when parsing history word designators. --- ChangeLog | 5 +++++ Src/hist.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 12797ff88..70f84ae15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2025-07-13 Bart Schaefer + + * 53820: Src/hist.c: detect integer overflow when parsing + history word designators. + 2025-06-01 Jun-ichi Takimoto * 53807: Completion/Darwin/Command/_nettop: new completion diff --git a/Src/hist.c b/Src/hist.c index 00bdbb2b8..4e4a20e31 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); -- cgit v1.2.3-70-g09d2