diff options
author | Elliott Hughes <enh@google.com> | 2022-09-14 00:30:25 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-09-14 00:30:25 +0000 |
commit | 95471615c83e3b3a09002496983ab86744b184cc (patch) | |
tree | cb2381cfb8f6edbc0e08b9214d3e79403aba770b | |
parent | 624aafd26c4e4d56e40ab160e7a02cad870d24e3 (diff) | |
parent | 5ccd4c5b18a6416fe6c9e7fdf21cd47b49e36536 (diff) | |
download | one-true-awk-95471615c83e3b3a09002496983ab86744b184cc.tar.gz |
Upgrade one-true-awk to 9e248c317b88470fc86aa7c988919dc49452c88c am: fbf461f5d4 am: 05af1187ef am: 4f2c842ed4 am: 5ccd4c5b18
Original change: https://android-review.googlesource.com/c/platform/external/one-true-awk/+/2215702
Change-Id: I24f2e91fc348e7234b4669924cad1eb7a3de7a11
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | FIXES | 5 | ||||
-rw-r--r-- | METADATA | 6 | ||||
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | run.c | 5 | ||||
-rw-r--r-- | tran.c | 3 |
5 files changed, 13 insertions, 8 deletions
@@ -25,6 +25,11 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August 1987. +Sep 12, 2022: + adjbuf minlen error (cannot be 0) in cat, resulting in NULL pbuf. + discovered by todd miller. also use-after-free issue with + tempfree in cat, thanks to Miguel Pineiro Jr and valgrind. + Aug 30, 2022: Various leaks and use-after-free issues plugged/fixed. Thanks to Miguel Pineiro Jr. <mpj@pineiro.cc>. @@ -5,11 +5,11 @@ third_party { type: GIT value: "https://github.com/onetrueawk/awk.git" } - version: "30791e0f686010b39c1ab2121df85da180960d53" + version: "9e248c317b88470fc86aa7c988919dc49452c88c" license_type: NOTICE last_upgrade_date { year: 2022 - month: 8 - day: 31 + month: 9 + day: 12 } } @@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ****************************************************************/ -const char *version = "version 20220830"; +const char *version = "version 20220912"; #define DEBUG #include <stdio.h> @@ -1197,16 +1197,17 @@ Cell *cat(Node **a, int q) /* a[0] cat a[1] */ x = execute(a[0]); n1 = strlen(getsval(x)); - adjbuf(&s, &ssz, n1, recsize, 0, "cat1"); + adjbuf(&s, &ssz, n1 + 1, recsize, 0, "cat1"); memcpy(s, x->sval, n1); + tempfree(x); + y = execute(a[1]); n2 = strlen(getsval(y)); adjbuf(&s, &ssz, n1 + n2 + 1, recsize, 0, "cat2"); memcpy(s + n1, y->sval, n2); s[n1 + n2] = '\0'; - tempfree(x); tempfree(y); z = gettemp(); @@ -563,7 +563,6 @@ Cell *catstr(Cell *a, Cell *b) /* concatenate a and b */ char *qstring(const char *is, int delim) /* collect string up to next delim */ { - const char *os = is; int c, n; const uschar *s = (const uschar *) is; uschar *buf, *bp; @@ -572,7 +571,7 @@ char *qstring(const char *is, int delim) /* collect string up to next delim */ FATAL( "out of space in qstring(%s)", s); for (bp = buf; (c = *s) != delim; s++) { if (c == '\n') - SYNTAX( "newline in string %.20s...", os ); + SYNTAX( "newline in string %.20s...", is ); else if (c != '\\') *bp++ = c; else { /* \something */ |