fix a kernel clobberer that showed up when running gcc. Was able to successfully build a hello world app with gcc after this.
The kernel arg logic was faulty, and wasn't using strlcpy properly (which returns the size of the src string, not the remaining size). Replaced it with a simpler, but less efficient series of strlcat()s. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20162 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
1cbf8f4b3c
commit
040e5e50f1
@ -777,23 +777,10 @@ team_create_thread_start(void *args)
|
||||
TRACE(("team_create_thread_start: loading elf binary '%s'\n", path));
|
||||
|
||||
// add args to info member
|
||||
sizeLeft = strlcpy(team->args, path, sizeof(team->args));
|
||||
udest = team->args + sizeLeft;
|
||||
sizeLeft = sizeof(team->args) - sizeLeft;
|
||||
|
||||
for (i = 1; i < argCount && sizeLeft > 2; i++) {
|
||||
size_t length;
|
||||
|
||||
udest[0] = ' ';
|
||||
udest++;
|
||||
sizeLeft--;
|
||||
|
||||
length = strlcpy(udest, teamArgs->args[i], sizeLeft);
|
||||
if (length >= sizeLeft)
|
||||
break;
|
||||
|
||||
sizeLeft -= length;
|
||||
udest += length;
|
||||
team->args[0] = 0;
|
||||
for (i = 1; i < argCount; i++) {
|
||||
strlcat(team->args, " ", sizeof(team->args));
|
||||
strlcat(team->args, teamArgs->args[i], sizeof(team->args));
|
||||
}
|
||||
|
||||
free_team_arg(teamArgs);
|
||||
|
Loading…
x
Reference in New Issue
Block a user