From: Mark Andrews Date: Thu, 13 Aug 2020 06:42:40 +0000 (+1000) Subject: Address infinite loop on EOF. X-Git-Tag: v9.17.5~52^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c59ab04f6f2aec88ea3a99a0c36f0f0188001e3a;p=thirdparty%2Fbind9.git Address infinite loop on EOF. --- diff --git a/fuzz/isc_lex_getmastertoken.c b/fuzz/isc_lex_getmastertoken.c index a9beb7d681d..2649dd0cfbf 100644 --- a/fuzz/isc_lex_getmastertoken.c +++ b/fuzz/isc_lex_getmastertoken.c @@ -47,6 +47,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { isc_buffer_t buf; isc_result_t result; + isc_token_t token; isc_tokentype_t expect; bool eol; @@ -69,9 +70,8 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { CHECK(isc_lex_openbuffer(lex, &buf)); do { - isc_token_t token; result = isc_lex_getmastertoken(lex, &token, expect, eol); - } while (result == ISC_R_SUCCESS); + } while (result == ISC_R_SUCCESS && token.type != isc_tokentype_eof); return (0); }