From 1976f60c890d82000a6a1de0a75ceac217348f3b Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=98=A4=ED=98=95=EC=84=9D/On-Device=20Lab=28SR=29/Staff?= =?utf8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Fri, 6 Sep 2019 19:15:57 +0900 Subject: [PATCH] Check OOR exception intflite_benchmark (#7260) Add try-catch to catch OOR exception by substr Signed-off-by: Hyeongseok Oh --- tests/tools/tflite_benchmark/src/tflite_benchmark.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/tools/tflite_benchmark/src/tflite_benchmark.cc b/tests/tools/tflite_benchmark/src/tflite_benchmark.cc index 634b149..21eee4a 100644 --- a/tests/tools/tflite_benchmark/src/tflite_benchmark.cc +++ b/tests/tools/tflite_benchmark/src/tflite_benchmark.cc @@ -52,11 +52,21 @@ void help(std::ostream &out, const int argc, char **argv) bool checkParams(const int argc, char **argv) { - if (argc < 2) + try { - help(std::cerr, argc, argv); + if (argc < 2) + { + help(std::cerr, argc, argv); + return false; + } + } + catch (const std::exception &e) + { + std::cerr << e.what() << std::endl; + return false; } + return true; } -- 2.7.4