@@ -1719,13 +1719,6 @@ TEST_P(Test_TensorFlow_layers, tf2_permute_nhwc_ncwh)
17191719 runTensorFlowNet (" tf2_permute_nhwc_ncwh" );
17201720}
17211721
1722- // issue #21852
1723- TEST_P (Test_TensorFlow_layers, tf_graph_simplifier_buffer_overflow)
1724- {
1725- // This just shouldn't segfault, otherwise it's fine
1726- EXPECT_ANY_THROW (readNetFromTensorflow (path (" tf_graph_simplifier_buffer_overflow_net.pb" )));
1727- }
1728-
17291722TEST_P (Test_TensorFlow_layers, squeeze)
17301723{
17311724#if defined(INF_ENGINE_RELEASE)
@@ -1899,4 +1892,25 @@ TEST_P(Test_TensorFlow_nets, EfficientDet)
18991892 expectNoFallbacksFromIE (net);
19001893}
19011894
1895+ TEST (Test_TensorFlow_Importer, tf_graph_simplifier_buffer_overflow_21852)
1896+ {
1897+ uint8_t payload[] = {0x08 , 0x08 , 0x0a , 0x00 , 0x0a , 0x00 };
1898+ EXPECT_ANY_THROW (readNetFromTensorflow (reinterpret_cast <const char *>(payload), sizeof (payload) / sizeof (payload[0 ])));
1899+ }
1900+
1901+ // can be triggered with -fsanitize=address
1902+ TEST (Test_TensorFlow_Importer, tf_graph_simplifier_buffer_overflow_21947)
1903+ {
1904+ uint8_t payload[] = {0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 ,
1905+ 0xba , 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 ,
1906+ 0x0a , 0xbd , 0x00 , 0x1a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0xba ,
1907+ 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 ,
1908+ 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0xba , 0x0a , 0x00 ,
1909+ 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0xba ,
1910+ 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 ,
1911+ 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0x2a , 0x00 , 0xba , 0x0a , 0x00 ,
1912+ 0x0a , 0x00 , 0x5d , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x00 , 0x0a , 0x40 };
1913+ EXPECT_ANY_THROW (readNetFromTensorflow (reinterpret_cast <const char *>(payload), sizeof (payload) / sizeof (payload[0 ])));
1914+ }
1915+
19021916}
0 commit comments