aboutsummaryrefslogtreecommitdiff
path: root/src/crunch.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2025-12-01 14:25:18 -0500
committerB. Watson <urchlay@slackware.uk>2025-12-01 14:26:18 -0500
commit743da665691496b4fc2238d72cb1d9037c531895 (patch)
tree1a709c1f8189e5add84341d60234153d7853f48e /src/crunch.c
parentdfe0a77f5d7a3847ab5475065516a6dc7755f61f (diff)
downloadalftools-743da665691496b4fc2238d72cb1d9037c531895.tar.gz
alf: Don't match token past end of input.
Diffstat (limited to 'src/crunch.c')
-rw-r--r--src/crunch.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/crunch.c b/src/crunch.c
index 2bef18d..880f059 100644
--- a/src/crunch.c
+++ b/src/crunch.c
@@ -98,6 +98,9 @@ token_t *match_token(int pos) {
t = &root_tokens[input_buf[pos]];
new_pos = pos + 1;
+ if(new_pos == input_len)
+ return t;
+
p = t;
while((p = get_kid(t, input_buf[new_pos]))) {
t = p;