From 7f8d3aa63899a3e3362c95eb7d1b04a5899660bd Mon Sep 17 00:00:00 2001 From: Andrey Somsikov Date: Sat, 6 Mar 2021 13:06:40 +0300 Subject: [PATCH] Catch std::except in fuzz tests (#4610) Fuzz tests must catch all expected exceptions from IE. IE is using C++ std library which may raise standard exceptions which IE pass through. --- tests/fuzz/src/read_network-fuzzer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fuzz/src/read_network-fuzzer.cc b/tests/fuzz/src/read_network-fuzzer.cc index 87fbce9c86a..89c6958fee3 100644 --- a/tests/fuzz/src/read_network-fuzzer.cc +++ b/tests/fuzz/src/read_network-fuzzer.cc @@ -38,7 +38,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { try { InferenceEngine::Core ie; InferenceEngine::CNNNetwork network = ie.ReadNetwork(net, weights_blob); - } catch (const InferenceEngine::details::InferenceEngineException& error) { + } catch (const std::exception&) { return 0; // fail gracefully on expected exceptions }