mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-17 12:41:32 +00:00
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>
This commit is contained in:
parent
c8605bb4d8
commit
457dd025a2
1 changed files with 2 additions and 1 deletions
|
@ -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'))
|
||||
|
|
Loading…
Add table
Reference in a new issue