diff --git a/util/wmgenmenu.c b/util/wmgenmenu.c index aff43a70..95c20e5c 100644 --- a/util/wmgenmenu.c +++ b/util/wmgenmenu.c @@ -419,7 +419,9 @@ static void find_and_write(const char *group, char *list[][2], int this_is_termi } else { char comm[PATH_MAX], *ptr; - strcpy(comm, list[i][1]); + strncpy(comm, list[i][1], sizeof(comm) - 1); + comm[sizeof(comm) - 1] = '\0'; + /* delete character " !" from the command */ ptr = strchr(comm, '!'); while (ptr >= comm && (*ptr == '!' || isspace(*ptr)))