[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:
Joseph Huber 2024-08-06 13:02:05 -05:00
parent 5e6d5c01e0
commit 3983bf6040

View File

@ -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;
}