Serial magic should only match on full match

As was mentioned on the wii dual layer disc issue, this line is comparing binary sequences as strings, which fails very obviously because neither of the 'strings' tested are strings and it's very likely both start with \0.
This commit is contained in:
i30817 2018-04-11 01:37:35 +01:00 committed by GitHub
parent a3175a8fa3
commit 7da45bc789
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -381,7 +381,7 @@ int detect_system(intfstream_t *fd, const char **system_name)
if (read < MAGIC_LEN)
continue;
if (string_is_equal(MAGIC_NUMBERS[i].magic, magic))
if (memcmp(MAGIC_NUMBERS[i].magic, magic, MAGIC_LEN) == 0)
{
*system_name = MAGIC_NUMBERS[i].system_name;
rv = 0;