gawk/CVE-2026-40468-part1.patch
Jakub Martisko 9590e21a2c Fix CVEs 2026-40553, 2026-40467, CVE-2026-40468
Resolves: RHEL-223429
Resolves: RHEL-222590
Resolves: RHEL-222774
2026-08-24 09:29:11 +02:00

38 lines
958 B
Diff

From 062f2f2581b991362c046f7f2e238ffa34e6f8c7 Mon Sep 17 00:00:00 2001
From: "Arnold D. Robbins" <arnold@skeeve.com>
Date: Sat, 4 Apr 2026 21:45:58 +0300
Subject: [PATCH] Minor integer overflow fixes.
---
ChangeLog | 8 ++++++++
builtin.c | 2 +-
node.c | 2 +-
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/builtin.c b/builtin.c
index 4193d3497..f6a37ac76 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1805,7 +1805,7 @@ do_sub(int nargs, unsigned int flags)
char *repl;
char *replend;
size_t repllen;
- int sofar;
+ size_t sofar;
int ampersands;
int matches = 0;
Regexp *rp;
diff --git a/node.c b/node.c
index 021eaf6cd..81787e5f0 100644
--- a/node.c
+++ b/node.c
@@ -583,7 +583,7 @@ parse_escape(const char **string_ptr, const char **result, size_t *nbytes)
static char buf[MB_LEN_MAX];
enum escape_results retval = ESCAPE_OK;
int c = *(*string_ptr)++;
- int i;
+ int64_t i;
int count;
int j;
const char *start;