Accordingly to exec(3) manual the envp argument is an array of pointers to
null-terminated strings and must be terminated by a null pointer.
Without the terminator execvp fails and errno is set to 'Bad address'
Change-Id: I00e6927fd62323b7a9bea918cc79b0c4e02d77fd
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
}
free(envp_plugin);
+ /* Last element of envp must be the NULL-terminator to prevent execvp fail */
+ envp[envp_cnt] = NULL;
+
if(name) { // in case of shell execution directly
// Check the shell command validation.
if (!request_plugin_verification(SDBD_CMD_VERIFY_SHELLCMD, name)) {