diff options
author | Holger Brunck <holger.brunck@keymile.com> | 2013-07-08 07:06:49 (GMT) |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2013-07-15 21:06:09 (GMT) |
commit | 457dd025a2899dd486e594ce3dc4afaa4ea09998 (patch) | |
tree | 21c46a6e1a70f3fa27fa7346814a6e18bde288b2 /fs/cramfs/cramfs.c | |
parent | c8605bb4d8f0ded37e863b0a4fe2844ce5e8e2fa (diff) | |
download | u-boot-457dd025a2899dd486e594ce3dc4afaa4ea09998.tar.xz |
cramfs: fix bug for wrong filename comparison
"cramfsload uImage_1" succeeds even though the actual file is named
"uImage".
Fix file name comparison when one name is the prefix of the other.
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Wolfgang Denk <wd@denx.de>
cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
Diffstat (limited to 'fs/cramfs/cramfs.c')
-rw-r--r-- | fs/cramfs/cramfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c index 910955d..e578a1e 100644 --- a/fs/cramfs/cramfs.c +++ b/fs/cramfs/cramfs.c @@ -126,7 +126,8 @@ static unsigned long cramfs_resolve (unsigned long begin, unsigned long offset, namelen--; } - if (!strncmp (filename, name, namelen)) { + if (!strncmp(filename, name, namelen) && + (namelen == strlen(filename))) { char *p = strtok (NULL, "/"); if (raw && (p == NULL || *p == '\0')) |