diff --git a/rune/libenclave/internal/runtime/pal/api_linux_v2.go b/rune/libenclave/internal/runtime/pal/api_linux_v2.go index 9e7a65e65e94b2150aa2d0b5ba6d5d0fc8a544de..b0dab0563d939b8d6e395b1187fd23a848dbf3d7 100644 --- a/rune/libenclave/internal/runtime/pal/api_linux_v2.go +++ b/rune/libenclave/internal/runtime/pal/api_linux_v2.go @@ -76,12 +76,11 @@ func (pal *enclaveRuntimePalApiV2) exec(cmd []string, envs []string, stdio [3]*o // Skip cmd[0] as used as the executable. var exe *C.char - argc := len(cmd) + argc := len(cmd) + 1 pargs := make([]*C.char, argc) exe = C.CString(cmd[0]) defer C.free(unsafe.Pointer(exe)) if argc > 1 { - cmd = cmd[1:] for i, arg := range cmd { logrus.Debugf("arg[%d]: %s", i, arg) pargs[i] = C.CString(arg)