commit | 586197dfe42ffda777205b02fe404107eb7d974a | [log] [tgz] |
---|---|---|
author | Joe Hershberger <joe.hershberger@ni.com> | Wed Oct 03 09:38:50 2012 +0000 |
committer | Tom Rini <trini@ti.com> | Mon Oct 15 11:54:05 2012 -0700 |
tree | f7f06afcf49dac5dec0f5d33e4be48d3ab8e768a | |
parent | e4a223f04de2e271682f26d7b981c0012f6a459f [diff] [blame] |
env: Check for NULL pointer in envmatch() If the pointer passed into envmatch() is NULL, return -1 instead of crashing. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index d655ab9..1f9c674 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c
@@ -650,6 +650,9 @@ */ int envmatch(uchar *s1, int i2) { + if (s1 == NULL) + return -1; + while (*s1 == env_get_char(i2++)) if (*s1++ == '=') return i2;