$NetBSD: patch-ae,v 1.1 2004/01/21 16:26:37 cube Exp $ --- src/xmlparse.c.orig 2003-11-03 22:05:18.000000000 +0100 +++ src/xmlparse.c @@ -51,7 +51,7 @@ #include "xmlparse.h" #define malloc g_malloc -#define calloc(n,s) g_malloc0(n * s) +#define calloc(n,s) g_malloc0((n) * (s)) #define TAGSTACK_INCR 20 @@ -162,10 +162,11 @@ static void startElementH(struct parser_ e->attrs = NULL; if (attrs) { for (i = 0 ; attrs[i] ; i++) ; - e->attrs = calloc(i, sizeof(xmlChar *)); + e->attrs = calloc(i+1, sizeof(xmlChar *)); for (i = 0 ; attrs[i] ; i++) { e->attrs[i] = strdup(attrs[i]); } + e->attrs[i] = NULL; } /* lookup handler */