Fix a small buffer overflow when disabling shuffle playback

Repeat 10 times:
 - strcat() is evil
 - strcat() is evil
 ...

While here fix another small inconsistency: Vorbis playback should
stop when switching 'shuffle' on.

The overflow was reported by @tomgreen66 in pull request #168.
This commit is contained in:
Yamagi Burmeister 2016-12-28 17:19:06 +01:00
parent c07fe5ac2d
commit af957c5e36

View file

@ -1137,7 +1137,6 @@ CDShuffleFunc(void *unused)
if (ogg->value)
{
OGG_ParseCmd("?");
OGG_Stop();
}
}
else
@ -1146,11 +1145,10 @@ CDShuffleFunc(void *unused)
if (ogg->value)
{
if ((int)strtol(cl.configstrings[CS_CDTRACK], (char **)NULL,
10) < 10)
if ((int)strtol(cl.configstrings[CS_CDTRACK], (char **)NULL, 10) < 10)
{
char tmp[2] = "0";
OGG_ParseCmd(strcat(tmp, cl.configstrings[CS_CDTRACK]));
char tmp[3] = {'0', cl.configstrings[CS_CDTRACK][0], '\0'};
OGG_ParseCmd(tmp);
}
else
{