shithub: trueawk

Download patch

ref: 275a80ff33ef2782f27c4fd720b65645c89e2bbb
parent: 40f0527d5d1a32124163c4183d92f794844eb043
author: ozan yigit <ozan.yigit@gmail.com>
date: Mon Oct 11 20:06:51 EDT 2021

Heap buffer overflow from PR #83 fixed in #121

--- a/FIXES
+++ b/FIXES
@@ -25,6 +25,11 @@
 This file lists all bug fixes, changes, etc., made since the AWK book
 was sent to the printers in August, 1987.
 
+Oct 12, 2021:
+	The fix for #83 changed the code to insert 2 chars, but the
+	call to adjbuf just above it only allows for 1 char. This can
+	cause a heap buffer overflow.
+
 July 27, 2021:
 	As per IEEE Std 1003.1-2008, -F "str" is now consistent with
 	-v FS="str" when str is null. Thanks to Warner Losh.
--- a/main.c
+++ b/main.c
@@ -22,7 +22,7 @@
 THIS SOFTWARE.
 ****************************************************************/
 
-const char	*version = "version 20210724";
+const char	*version = "version 20211012";
 
 #define DEBUG
 #include <stdio.h>
--