From 85f6947f9f0c3a5ac7f70250b5c80627f2d18949 Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Tue, 1 Aug 2023 15:05:55 +0800
Subject: [PATCH] fix execlp not enough args

Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
---
 cmake/set_build_flags.cmake     | 2 +-
 test/fuzz/CMakeLists.txt        | 2 +-
 test/image/oci/oci_ut_common.cc | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cmake/set_build_flags.cmake b/cmake/set_build_flags.cmake
index ba250cd..09c85c6 100644
--- a/cmake/set_build_flags.cmake
+++ b/cmake/set_build_flags.cmake
@@ -3,7 +3,7 @@ set(CMAKE_C_FLAGS "-fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2 -O2 -Wall -fP
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
 
 if (GRPC_CONNECTOR)
-    set(CMAKE_CXX_FLAGS "-fPIC -std=c++11 -fstack-protector-all -D_FORTIFY_SOURCE=2 -O2 -Wall -Wno-error=deprecated-declarations")
+    set(CMAKE_CXX_FLAGS "-fPIC -std=c++17 -fstack-protector-all -D_FORTIFY_SOURCE=2 -O2 -Wall -Wno-error=deprecated-declarations")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
 endif()
 set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-E -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wtrampolines -shared -pthread")
diff --git a/test/fuzz/CMakeLists.txt b/test/fuzz/CMakeLists.txt
index 478a401..617a168 100644
--- a/test/fuzz/CMakeLists.txt
+++ b/test/fuzz/CMakeLists.txt
@@ -34,7 +34,7 @@ MESSAGE(STATUS "GCLANG_PP_BINARY is set to ${GCLANG_PP_BINARY}")
 SET(CMAKE_C_COMPILER "${GCLANG_BINARY}")
 SET(CMAKE_CXX_COMPILER "${GCLANG_PP_BINARY}")
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage -fsanitize=fuzzer,address -fsanitize-coverage=indirect-calls,trace-cmp,trace-div,trace-gep")
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 --coverage -std=c++11 -fsanitize=fuzzer,address -fsanitize-coverage=indirect-calls,trace-cmp,trace-div,trace-gep")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 --coverage -std=c++17 -fsanitize=fuzzer,address -fsanitize-coverage=indirect-calls,trace-cmp,trace-div,trace-gep")
 SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
 
 SET(EXE0 test_volume_mount_spec_fuzz)
diff --git a/test/image/oci/oci_ut_common.cc b/test/image/oci/oci_ut_common.cc
index 1158ae8..9fa25d1 100644
--- a/test/image/oci/oci_ut_common.cc
+++ b/test/image/oci/oci_ut_common.cc
@@ -22,7 +22,7 @@
 
 int execvp_success(const char *file, char * const argv[])
 {
-    execlp("echo", "echo");
+    execlp("echo", "echo", NULL);
     return -1;
 }
 
-- 
2.25.1

