Merge pull request #6555 from i30817/patch-1

Serial magic should only match on full match
This commit is contained in:
Twinaphex 2018-04-11 03:26:44 +02:00 committed by GitHub
commit f62ad312eb
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;