Skip to content

Commit

Permalink
fix: broken F_BunnyScroll due to uninitialized buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
shaneutt committed Aug 31, 2022
1 parent 8542b8f commit 9061b80
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions doomclassic/doom/f_finale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,8 @@ void F_BunnyScroll (void)
int x;
patch_t* p1;
patch_t* p2;
char name[10];
size_t name_len = 10;
char name[name_len];
int stage;

p1 = (patch_t*)W_CacheLumpName ("PFUB2", PU_LEVEL_SHARED);
Expand Down Expand Up @@ -765,8 +766,8 @@ void F_BunnyScroll (void)
S_StartSound (NULL, sfx_pistol);
::g->laststage = stage;
}
snprintf (name, strlen(name), "END%i",stage);

snprintf(name, name_len, "END%i", stage);
V_DrawPatch ((ORIGINAL_WIDTH-13*8)/2, (ORIGINAL_HEIGHT-8*8)/2,0, (patch_t*)W_CacheLumpName (name,PU_CACHE_SHARED));
}

Expand Down

0 comments on commit 9061b80

Please sign in to comment.