From c2d4f9b611c43697e889d991d8a4edea92ef2d76 Mon Sep 17 00:00:00 2001 From: Paulo Alcantara Date: Tue, 5 Jul 2011 22:12:24 +0000 Subject: [PATCH] extlinux: remove wrong use of strstr() strstr() is only used for zero-terminated strings, so OEM Name is not guaranteed to be zero-terminated. Instead, use fat_check_sb_fields() to sanity check FAT superblock. Signed-off-by: Paulo Alcantara --- extlinux/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/extlinux/main.c b/extlinux/main.c index 6aa6202..26dba7b 100755 --- a/extlinux/main.c +++ b/extlinux/main.c @@ -347,9 +347,7 @@ int install_bootblock(int fd, const char *device) perror("reading fat superblock"); return 1; } - if (sb3.bsResSectors && sb3.bsFATs && - (strstr(sb3.bs16.FileSysType, "FAT") || - strstr(sb3.bs32.FileSysType, "FAT"))) + if (fat_check_sb_fields(&sb3)) ok = true; } if (!ok) { -- 2.7.4