mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 02:30:46 +00:00
Fix a potential out-of-bounds read and write when loading the help file
in Mapster32. git-svn-id: https://svn.eduke32.com/eduke32@2161 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
d806bc9fea
commit
c112cdde89
1 changed files with 2 additions and 1 deletions
|
@ -2018,7 +2018,8 @@ static void ReadHelpFile(const char *name)
|
|||
if (charsread>0)
|
||||
{
|
||||
tempbuf[charsread-1]=0;
|
||||
if (tempbuf[charsread-2]==0x0d) tempbuf[charsread-2]=0;
|
||||
if (charsread>=2 && tempbuf[charsread-2]==0x0d)
|
||||
tempbuf[charsread-2]=0;
|
||||
}
|
||||
|
||||
Bmemcpy(hp->line[j], tempbuf, 80);
|
||||
|
|
Loading…
Reference in a new issue