diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2020-12-14 21:35:49 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2020-12-14 21:35:49 -0800 |
| commit | 29f993f9847e56af3f0aa246774cd9890c7edf85 (patch) | |
| tree | d3ec32d9f2b4f5232f0ffb43f39910998253a5cb | |
| parent | a8b844cfb6e5a51db07a67b83b85ffa71bdcff2b (diff) | |
Bug fix for literals exceeding end of file
| -rw-r--r-- | vm.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -110,6 +110,7 @@ static match_t *_match(grammar_t *g, file_t *f, const char *str, vm_op_t *op, un return m; } case VM_STRING: { + if (&str[op->len] > f->end) return NULL; if ((flags & BPEG_IGNORECASE) ? strncasecmp(str, op->args.s, (size_t)op->len) != 0 : strncmp(str, op->args.s, (size_t)op->len) != 0) return NULL; |
