From: Paulo Alcantara Date: Tue, 5 Jul 2011 22:12:24 +0000 (+0000) Subject: extlinux: remove wrong use of strstr() X-Git-Tag: syslinux-4.05-pre4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Fsyslinux-4.05-pre4;p=profile%2Fivi%2Fsyslinux.git 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 --- 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) {