From dfbbf60ff332e21e6ea21f1781f137d138dcf99a Mon Sep 17 00:00:00 2001 From: Thomas Beierlein Date: Sun, 22 Oct 2023 20:59:47 +0200 Subject: [PATCH] Fix possible segfault if TERM variable not existent. (#413) --- src/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.c b/src/main.c index ef0d4e12..95a4d76e 100644 --- a/src/main.c +++ b/src/main.c @@ -513,6 +513,8 @@ static void ui_init() { /* getting users terminal string and (if RXVT) setting rxvt colours on it */ /* LZ3NY hack :) */ char *term = getenv("TERM"); + if (term == NULL) + term = ""; if (strcasecmp(term, "rxvt") == 0 || strcasecmp(term, "rxvt-unicode") == 0) { use_rxvt = true;