summaryrefslogtreecommitdiffstats
path: root/common/cmd_nvedit.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/cmd_nvedit.c')
-rw-r--r--common/cmd_nvedit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 8ecc498230..bb1d4ec3e5 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -215,6 +215,9 @@ int env_check_apply(const char *name, const char *oldval,
{
int console = -1;
+ /* Default value for NULL to protect string-manipulating functions */
+ newval = newval ? : "";
+
/* Check for console redirection */
if (strcmp(name, "stdin") == 0)
console = stdin;
OpenPOWER on IntegriCloud