1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-02 01:02:19 +02:00

Avoid dereferencing NULL in find_cmd() if no valid commands were found

Patch by Andrew Dyer, 13 Jun 2005
This commit is contained in:
Wolfgang Denk
2006-03-12 02:20:55 +01:00
parent 6cb142fa3b
commit 1264b4050c
2 changed files with 9 additions and 3 deletions

View File

@@ -2,6 +2,9 @@
Changes since U-Boot 1.1.4: Changes since U-Boot 1.1.4:
====================================================================== ======================================================================
* Avoid dereferencing NULL in find_cmd() if no valid commands were found
Patch by Andrew Dyer, 13 Jun 2005
* Add ADI Blackfin support * Add ADI Blackfin support
- add support for Analog Devices Blackfin BF533 CPU - add support for Analog Devices Blackfin BF533 CPU
- add support for the ADI BF533 Stamp uClinux board - add support for the ADI BF533 Stamp uClinux board

View File

@@ -919,7 +919,10 @@ int run_command (const char *cmd, int flag)
process_macros (token, finaltoken); process_macros (token, finaltoken);
/* Extract arguments */ /* Extract arguments */
argc = parse_line (finaltoken, argv); if ((argc = parse_line (finaltoken, argv)) == 0) {
rc = -1; /* no command at all */
continue;
}
/* Look up command in command table */ /* Look up command in command table */
if ((cmdtp = find_cmd(argv[0])) == NULL) { if ((cmdtp = find_cmd(argv[0])) == NULL) {
@@ -945,10 +948,10 @@ int run_command (const char *cmd, int flag)
puts ("'bootd' recursion detected\n"); puts ("'bootd' recursion detected\n");
rc = -1; rc = -1;
continue; continue;
} } else {
else
flag |= CMD_FLAG_BOOTD; flag |= CMD_FLAG_BOOTD;
} }
}
#endif /* CFG_CMD_BOOTD */ #endif /* CFG_CMD_BOOTD */
/* OK - call function to do the command */ /* OK - call function to do the command */