summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2020-07-13 10:10:11 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2020-07-13 10:10:11 +0000
commit081f8ecebd4f7fcc6882b0df75126ed70d1b609c (patch)
tree158876c69f8e5a08333bb4d241cb7c1624024b89 /usr.bin/tmux
parent49bcb32d18511843672ff708bf284e994d654fbd (diff)
Do not dereference NULL environment variable value, GitHub issue 2304.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/cmd-parse.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-parse.y b/usr.bin/tmux/cmd-parse.y
index 732f4cb419f..2c701ba7706 100644
--- a/usr.bin/tmux/cmd-parse.y
+++ b/usr.bin/tmux/cmd-parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-parse.y,v 1.30 2020/06/04 16:06:01 nicm Exp $ */
+/* $OpenBSD: cmd-parse.y,v 1.31 2020/07/13 10:10:10 nicm Exp $ */
/*
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1432,7 +1432,7 @@ yylex_token_variable(char **buf, size_t *len)
name[namelen] = '\0';
envent = environ_find(global_environ, name);
- if (envent != NULL) {
+ if (envent != NULL && envent->value != NULL) {
value = envent->value;
log_debug("%s: %s -> %s", __func__, name, value);
yylex_append(buf, len, value, strlen(value));