mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 17:36:05 +00: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:
parent
5e6d5c01e0
commit
3983bf6040
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user