summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editors/awk.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/editors/awk.c b/editors/awk.c
index bafc9ba..af103e3 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -1849,6 +1849,8 @@ static void handle_special(var *v)
if (v == intvar[NF]) {
n = (int)getvar_i(v);
+ if (n < 0)
+ syntax_error("NF set to negative value");
fsrealloc(n);
/* recalculate $0 */