Skip to content

Commit

Permalink
ASY_Load: avoid uninitialized reads from DupStr().
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Dec 25, 2021
1 parent 4693928 commit 605e9f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libmikmod/loaders/load_asy.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ static BOOL ASY_Load(BOOL curious)
_mm_fseek(modreader, 0x126 + (t*37), SEEK_SET);

_mm_read_string(s->samplename, 22, modreader);
s->samplename[21] = 0; /* just in case */
s->samplename[22] = 0;

s->finetune = _mm_read_UBYTE(modreader);
s->volume = _mm_read_UBYTE(modreader);
Expand All @@ -339,7 +339,7 @@ static BOOL ASY_Load(BOOL curious)
of.inittempo = mh->inittempo;
of.numchn = 8;
modtype = 0;
of.songname = DupStr(mh->songname, 21, 1);
of.songname = MikMod_strdup("");
of.numpos = mh->num_orders;
of.reppos = mh->reppos;
of.numpat = mh->num_patterns;
Expand Down

0 comments on commit 605e9f3

Please sign in to comment.