Skip to content

Commit b61f10d

Browse files
committed
environment: fix segfault
1 parent 5dc8f72 commit b61f10d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/environment.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ QString environment_get(const char *key)
3535

3636
void environment_set(const char *key, const char *value)
3737
{
38+
if (!key || !*key) {
39+
return;
40+
}
41+
if (!value || !*value) {
42+
return;
43+
}
3844
/* set cursor for labwc - should cover 'replace' or 'append' */
3945
char xcur[4096] = { 0 };
4046
strcpy(xcur, key);

0 commit comments

Comments
 (0)