2026-04-04         Arnold D. Robbins     <arnold@skeeve.com>

	* builtin.c (do_sub): Make `sofar' be size_t to avoid
	integer overflows.  Thanks to Michał Majchrowicz
	<mmajchrowicz@afine.com> for the report.
	* node.c (parse_escape): Change `i' to int64_t to avoid
	overflows. Thanks to ASan with gcc -m32.

Index: gawk-5.3.2/builtin.c
===================================================================
--- gawk-5.3.2.orig/builtin.c
+++ gawk-5.3.2/builtin.c
@@ -1809,7 +1809,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;
Index: gawk-5.3.2/node.c
===================================================================
--- gawk-5.3.2.orig/node.c
+++ gawk-5.3.2/node.c
@@ -584,7 +584,7 @@ parse_escape(const char **string_ptr, co
 	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;
