input is not null-terminated so we need to check for length first.
From: Yuxuan Shui yshui@codeweavers.com
input is not null-terminated so we need to check for length first. --- programs/find/tests/find.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/programs/find/tests/find.c b/programs/find/tests/find.c index 10fd8ad8ae3..70d3cb9338e 100644 --- a/programs/find/tests/find.c +++ b/programs/find/tests/find.c @@ -105,7 +105,7 @@ static void mangle_text(const BYTE *input, int input_len, BYTE *output, int outp int count_wchar;
/* Check for UTF-16 LE BOM */ - if (input[0] == 0xFF && input[1] == 0xFE) + if (input_len > 1 && input[0] == 0xFF && input[1] == 0xFE) { int buffer_count = 0; int i;