commit b24a66c40a7902a9b485bb11d635270419e20a9f
parent 1f6055001e2161a2888612cb74ebc6294a6ed9e6
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
@@ -378,7 +378,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++) {