diff options
author | ozan yigit <ozan.yigit@gmail.com> | 2023-10-30 19:56:09 -0400 |
---|---|---|
committer | ozan yigit <ozan.yigit@gmail.com> | 2023-10-30 19:56:09 -0400 |
commit | 9666b77b369e342353c29eed5415123f58e58948 (patch) | |
tree | baa8d97e3e2432ff25764bd3b83ba85e9f996bc9 | |
parent | 0575fbc687f4ce8de6e25848350069a44bbe48ff (diff) | |
parent | 0048c96e94c732c6fb2ebe50eeb3450c1672fe0f (diff) | |
download | one-true-awk-9666b77b369e342353c29eed5415123f58e58948.tar.gz |
todd miller's fix for big-endian systems, and out of bounds read
for empty CCL.
-rw-r--r-- | b.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -529,7 +529,7 @@ int first(Node *p) /* collects initially active leaves of p into setvec */ setvec[lp] = 1; setcnt++; } - if (type(p) == CCL && (*(char *) right(p)) == '\0') + if (type(p) == CCL && (*(int *) right(p)) == 0) return(0); /* empty CCL */ return(1); case PLUS: @@ -970,7 +970,7 @@ Node *primary(void) rtok = relex(); if (rtok == ')') { /* special pleading for () */ rtok = relex(); - return unary(op2(CCL, NIL, (Node *) tostring(""))); + return unary(op2(CCL, NIL, (Node *) cclenter(""))); } np = regexp(); if (rtok == ')') { @@ -993,7 +993,7 @@ Node *concat(Node *np) return (concat(op2(CAT, np, primary()))); case EMPTYRE: rtok = relex(); - return (concat(op2(CAT, op2(CCL, NIL, (Node *) tostring("")), + return (concat(op2(CAT, op2(CCL, NIL, (Node *) cclenter("")), primary()))); } return (np); |