mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
Merge branch 'fix-profile-unsafety' into 'master'
Fix uninitialized memory in Profile Card Closes #896 See merge request KartKrew/Kart!1821
This commit is contained in:
commit
7d5b0b9e75
1 changed files with 3 additions and 2 deletions
|
|
@ -49,7 +49,7 @@ profile_t* PR_MakeProfile(
|
||||||
INT32 controlarray[num_gamecontrols][MAXINPUTMAPPING],
|
INT32 controlarray[num_gamecontrols][MAXINPUTMAPPING],
|
||||||
boolean guest)
|
boolean guest)
|
||||||
{
|
{
|
||||||
profile_t *new = Z_Malloc(sizeof(profile_t), PU_STATIC, NULL);
|
profile_t *new = Z_Calloc(sizeof(profile_t), PU_STATIC, NULL);
|
||||||
|
|
||||||
new->version = PROFILEVER;
|
new->version = PROFILEVER;
|
||||||
|
|
||||||
|
|
@ -73,6 +73,7 @@ profile_t* PR_MakeProfile(
|
||||||
new->kickstartaccel = false;
|
new->kickstartaccel = false;
|
||||||
new->autoroulette = false;
|
new->autoroulette = false;
|
||||||
new->litesteer = true;
|
new->litesteer = true;
|
||||||
|
new->rumble = true;
|
||||||
|
|
||||||
// Copy from gamecontrol directly as we'll be setting controls up directly in the profile.
|
// Copy from gamecontrol directly as we'll be setting controls up directly in the profile.
|
||||||
memcpy(new->controls, controlarray, sizeof(new->controls));
|
memcpy(new->controls, controlarray, sizeof(new->controls));
|
||||||
|
|
@ -351,7 +352,7 @@ void PR_LoadProfiles(void)
|
||||||
|
|
||||||
for (i = 1; i < numprofiles; i++)
|
for (i = 1; i < numprofiles; i++)
|
||||||
{
|
{
|
||||||
profilesList[i] = Z_Malloc(sizeof(profile_t), PU_STATIC, NULL);
|
profilesList[i] = Z_Calloc(sizeof(profile_t), PU_STATIC, NULL);
|
||||||
|
|
||||||
// Version. (We always update this on successful forward step)
|
// Version. (We always update this on successful forward step)
|
||||||
profilesList[i]->version = PROFILEVER;
|
profilesList[i]->version = PROFILEVER;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue