From: Christophe CURIS <christophe.cu...@free.fr> As pointed by Coverity, the buffer used to store the command for the menu has a fixed size, so a check is welcome to avoid buffer overflow.
Signed-off-by: Christophe CURIS <christophe.cu...@free.fr> --- util/wmgenmenu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/wmgenmenu.c b/util/wmgenmenu.c index aff43a7..95c20e5 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))) -- 1.9.2 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.