mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-13 20:40:31 +01:00
Check for illegal character '=' in environment variable names.
Make sure the string passed as variable name does not contain a '=' character. This not only prevents the common error or typing "setenv foo=bar" instead of "setenv foo bar", but (more importantly) also closes a backdoor which allowed to delete write-protected environment variables, for example by using "setenv ethaddr=".
This commit is contained in:
parent
19973b6ad9
commit
471a7be7a0
1 changed files with 5 additions and 0 deletions
|
|
@ -167,6 +167,11 @@ int _do_setenv (int flag, int argc, char *argv[])
|
|||
|
||||
name = argv[1];
|
||||
|
||||
if (strchr(name, '=')) {
|
||||
printf ("## Error: illegal character '=' in variable name \"%s\"\n", name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* search if variable with this name already exists
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue