mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 15:05:23 +00:00
Address infinite loop on EOF.
This commit is contained in:
@@ -47,6 +47,7 @@ int
|
|||||||
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||||
isc_buffer_t buf;
|
isc_buffer_t buf;
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
|
isc_token_t token;
|
||||||
isc_tokentype_t expect;
|
isc_tokentype_t expect;
|
||||||
bool eol;
|
bool eol;
|
||||||
|
|
||||||
@@ -69,9 +70,8 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||||||
CHECK(isc_lex_openbuffer(lex, &buf));
|
CHECK(isc_lex_openbuffer(lex, &buf));
|
||||||
|
|
||||||
do {
|
do {
|
||||||
isc_token_t token;
|
|
||||||
result = isc_lex_getmastertoken(lex, &token, expect, eol);
|
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);
|
return (0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user