Exle / aimp-discord-presence

Plugin for AIMP that changes the status of Discord, depending on what you are listening to.
http://www.aimp.ru/?do=catalog&rec_id=970
100 stars 20 forks source link

[BUG] Possible memory corruption #12

Closed ArtemIzmaylov closed 4 years ago

ArtemIzmaylov commented 5 years ago

Plugin uses static size array to copy the data from the player:

BOOL AIMPRemote::InfoUpdateTrackInfo()
{
    WCHAR buffer[256];

But it does not check actual value length before copy the data:

        memcpy(buffer, offset, AIMPRemote_TrackInfo->AlbumLength * 2);
    buffer[AIMPRemote_TrackInfo->AlbumLength] = 0;

So, if length of value in tag field is more or equal to 256 symbols plugin produces a memory corruption.

Exle commented 4 years ago

Fixed with commit b2e42290cd60ea6a559719b5e4a0b9e4e0e09cd4