- made D_WriteUserInfoStrings memory safe.
Its callers are anything but for now but this function was the main blocker for refactoring so it had to come first.
This commit is contained in:
parent
cbff526cc7
commit
ee5b6e45f8
4 changed files with 65 additions and 61 deletions
|
|
@ -1505,7 +1505,9 @@ bool DoArbitrate (void *userdata)
|
|||
netbuffer[1] = consoleplayer;
|
||||
netbuffer[9] = data->gotsetup[0];
|
||||
stream = &netbuffer[10];
|
||||
D_WriteUserInfoStrings (consoleplayer, &stream, true);
|
||||
auto str = D_GetUserInfoStrings (consoleplayer, true);
|
||||
memcpy(stream, str.GetChars(), str.Len() + 1);
|
||||
stream += str.Len();
|
||||
SendSetup (data->playersdetected, data->gotsetup, int(stream - netbuffer));
|
||||
}
|
||||
else
|
||||
|
|
@ -1520,7 +1522,9 @@ bool DoArbitrate (void *userdata)
|
|||
{
|
||||
netbuffer[1] = j;
|
||||
stream = &netbuffer[9];
|
||||
D_WriteUserInfoStrings (j, &stream, true);
|
||||
auto str = D_GetUserInfoStrings(j, true);
|
||||
memcpy(stream, str.GetChars(), str.Len() + 1);
|
||||
stream += str.Len();
|
||||
HSendPacket (i, int(stream - netbuffer));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue