[putenv_term] don't dereference NULL when lacking TERM variable #1348

This commit is contained in:
nick black 2021-10-18 19:29:31 -04:00
parent 5010911a08
commit 51043fc959
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -1210,7 +1210,7 @@ int putenv_term(const char* termname){
}else{
loginfo("provided %s value %s\n", ENVVAR, termname);
}
if(strcmp(oldterm, termname) == 0){
if(oldterm && strcmp(oldterm, termname) == 0){
return 0;
}
char* buf = malloc(strlen(termname) + strlen(ENVVAR) + 1);