mirror of
https://github.com/tmux/tmux.git
synced 2025-04-04 15:25:29 +00:00
Do not dereference NULL environment variable value, GitHub issue 2304.
This commit is contained in:
parent
f26b7b7788
commit
468be2a37f
@ -1432,7 +1432,7 @@ yylex_token_variable(char **buf, size_t *len)
|
|||||||
name[namelen] = '\0';
|
name[namelen] = '\0';
|
||||||
|
|
||||||
envent = environ_find(global_environ, name);
|
envent = environ_find(global_environ, name);
|
||||||
if (envent != NULL) {
|
if (envent != NULL && envent->value != NULL) {
|
||||||
value = envent->value;
|
value = envent->value;
|
||||||
log_debug("%s: %s -> %s", __func__, name, value);
|
log_debug("%s: %s -> %s", __func__, name, value);
|
||||||
yylex_append(buf, len, value, strlen(value));
|
yylex_append(buf, len, value, strlen(value));
|
||||||
|
Loading…
Reference in New Issue
Block a user