mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 12:26:52 +08:00
[libc] Fix GPU argument vector writing nullptr to string
Summary: The intention behind this code was to null terminate the `envp` string, but it accidentally went into the string data.
This commit is contained in:
@@ -85,7 +85,7 @@ void *copy_argument_vector(int argc, const char **argv, Allocator alloc) {
|
||||
}
|
||||
|
||||
// Ensure the vector is null terminated.
|
||||
reinterpret_cast<void **>(dev_argv)[argv_size] = nullptr;
|
||||
reinterpret_cast<void **>(dev_argv)[argc + 1] = nullptr;
|
||||
return dev_argv;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user