diff options
author | Marek BehĂșn <marek.behun@nic.cz> | 2021-10-17 18:36:33 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-10-21 21:50:48 +0300 |
commit | 6ba4473fb757e7606a4224d87774294c9d60d2cd (patch) | |
tree | 32ad464afe34d94d7917b6a2073ea434f97bcfd1 /cmd | |
parent | d1bca8d2a18eb4a850c0ecbc9327eb3dfa5df5e1 (diff) | |
download | u-boot-6ba4473fb757e7606a4224d87774294c9d60d2cd.tar.xz |
env: Don't match empty variable name in env_match()
Do we really allow zero-length variable name? I guess not.
Signed-off-by: Marek BehĂșn <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/nvedit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/nvedit.c b/cmd/nvedit.c index 5b1d4c2448..8d53579d92 100644 --- a/cmd/nvedit.c +++ b/cmd/nvedit.c @@ -708,7 +708,7 @@ char *from_env(const char *envvar) static const char *env_match(const char *p, const char *s1) { - if (s1 == NULL) + if (s1 == NULL || *s1 == '\0') return NULL; while (*s1 == *p++) |