awk: abort if NF set to negative value
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
572dfb8e78
commit
75a1c87357
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user