Skip to content

Commit

Permalink
Fix a buffer overflow
Browse files Browse the repository at this point in the history
Fixes #635

Thanks to HongxuChen for reporting it
  • Loading branch information
egli committed Sep 3, 2018
1 parent dd7b2fe commit 5e40896
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion liblouis/lou_translateString.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ matchCurrentInput(
const InString *input, int pos, const widechar *passInstructions, int passIC) {
int k;
int kk = pos;
for (k = passIC + 2; k < passIC + 2 + passInstructions[passIC + 1]; k++)
for (k = passIC + 2;
((k < passIC + 2 + passInstructions[passIC + 1]) && (kk < input->length));
k++)
if (input->chars[kk] == ENDSEGMENT || passInstructions[k] != input->chars[kk++])
return 0;
return 1;
Expand Down

0 comments on commit 5e40896

Please sign in to comment.