commit 7fbe24ea7bdeb0dc51c0ce55a1e0692b29f068ac
parent 2175e7fc9ebaebefe86216df8868def31bbe4339
Author: wwp <subscript@free.fr>
Date: Sat, 11 Sep 2021 14:20:08 +0200
Fix CID 1491385: buffer overrun (if copying all non-0 chars of name to newname, we still
need an extra room for a trailing 0).
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/grouplistdialog.c b/src/grouplistdialog.c
@@ -389,7 +389,7 @@ static GtkCMCTreeNode *grouplist_create_branch(NewsGroupInfo *ginfo,
static void grouplist_expand_upwards(GtkCMCTree *ctree, const gchar *name) {
const gchar *ptr;
- gchar *newname=g_malloc0(strlen(name));
+ gchar *newname=g_malloc0(strlen(name) + 1);
GtkCMCTreeNode *node;
for (ptr=name; *ptr; ptr++) {