aboutsummaryrefslogtreecommitdiff
path: root/bugs-fixed
diff options
context:
space:
mode:
authorTodd C. Miller <Todd.Miller@sudo.ws>2020-07-29 12:27:45 -0600
committerGitHub <noreply@github.com>2020-07-29 21:27:45 +0300
commit22ee26b925f0c93b3539efd2e195af74bdf34fac (patch)
tree706f086d88774839fc2bbe527b86db3063b98076 /bugs-fixed
parentb82b649aa65fbdff45869d1fd6d72fd2b85946cd (diff)
downloadone-true-awk-22ee26b925f0c93b3539efd2e195af74bdf34fac.tar.gz
Cast to uschar when storing a char in an int that will be used as an index (#88)
* Cast to uschar when storing a char in an int that will be used as an index. Fixes a heap underflow when the input char has the high bit set and FS is a regex. * Add regress test for underflow when RS is a regex and input is 8-bit.
Diffstat (limited to 'bugs-fixed')
-rw-r--r--bugs-fixed/rs_underflow.awk1
-rw-r--r--bugs-fixed/rs_underflow.in1
-rw-r--r--bugs-fixed/rs_underflow.ok1
3 files changed, 3 insertions, 0 deletions
diff --git a/bugs-fixed/rs_underflow.awk b/bugs-fixed/rs_underflow.awk
new file mode 100644
index 0000000..4cf1702
--- /dev/null
+++ b/bugs-fixed/rs_underflow.awk
@@ -0,0 +1 @@
+BEGIN { RS="zx" } { print $1 }
diff --git a/bugs-fixed/rs_underflow.in b/bugs-fixed/rs_underflow.in
new file mode 100644
index 0000000..74c8035
--- /dev/null
+++ b/bugs-fixed/rs_underflow.in
@@ -0,0 +1 @@
diff --git a/bugs-fixed/rs_underflow.ok b/bugs-fixed/rs_underflow.ok
new file mode 100644
index 0000000..74c8035
--- /dev/null
+++ b/bugs-fixed/rs_underflow.ok
@@ -0,0 +1 @@