From df4cc8d7079e6191bf0bb389da809736c5607b70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Mon, 12 Jun 2017 14:43:56 +0200 Subject: [PATCH] Fix crash in StringUtilities::cStringArrayToCppList() with NULL as argument --- wrappers/cpp/tools.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wrappers/cpp/tools.cc b/wrappers/cpp/tools.cc index 9f7cdc9a7..1ebe600cb 100644 --- a/wrappers/cpp/tools.cc +++ b/wrappers/cpp/tools.cc @@ -73,8 +73,8 @@ const char *StringUtilities::cppStringToC(const std::string &cppstr) { std::list StringUtilities::cStringArrayToCppList(const char **cArray) { list cppList; - int i; - for(i=0; cArray[i]!=NULL; i++) { + if (cArray == NULL) return cppList; + for(int i=0; cArray[i]!=NULL; i++) { cppList.push_back(cArray[i]); } return cppList;