From 7da45bc78981bfc24063f769bec99e7a85955120 Mon Sep 17 00:00:00 2001 From: i30817 Date: Wed, 11 Apr 2018 01:37:35 +0100 Subject: [PATCH] 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. --- tasks/task_database_cue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/task_database_cue.c b/tasks/task_database_cue.c index fa53bcb264..e6360d4d30 100644 --- a/tasks/task_database_cue.c +++ b/tasks/task_database_cue.c @@ -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;