diff options
author | Cody Peter Mello <melloc@writev.io> | 2018-09-14 17:29:06 -0700 |
---|---|---|
committer | Cody Peter Mello <melloc@writev.io> | 2018-09-14 17:34:17 -0700 |
commit | 6cf37e9d15c15a3ba5f5c93c05e2fcafc35a2338 (patch) | |
tree | 3c2f29edf927ee09f766f7909746e668363dc7b8 /run.c | |
parent | 2dc7e5ff1a4feeeb549f32706cf34e17aba89192 (diff) | |
download | one-true-awk-6cf37e9d15c15a3ba5f5c93c05e2fcafc35a2338.tar.gz |
Check for format character precision argument before using it
Diffstat (limited to 'run.c')
-rw-r--r-- | run.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -863,6 +863,9 @@ int format(char **pbuf, int *pbufsize, const char *s, Node *a) /* printf-like co FATAL("'$' not permitted in awk formats"); } if (*s == '*') { + if (a == NULL) { + FATAL("not enough args in printf(%s)", os); + } x = execute(a); a = a->nnext; sprintf(t-1, "%d", fmtwd=(int) getfval(x)); |