From 881970d92774eadd903c9ddfb276497894a1ef64 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zden=C4=9Bk=20Salvet?= Date: Mon, 13 Aug 2007 11:22:24 +0000 Subject: [PATCH] Cleanly ignore events of unknown type (fixes bug #28725). --- org.glite.lb.common/src/xml_parse.c.T | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/org.glite.lb.common/src/xml_parse.c.T b/org.glite.lb.common/src/xml_parse.c.T index cf265ff..9c06dc0 100644 --- a/org.glite.lb.common/src/xml_parse.c.T +++ b/org.glite.lb.common/src/xml_parse.c.T @@ -220,7 +220,7 @@ static void startQueryEvents(void *data, const char *el, const char **attr) if (!attr[0] || !attr[1]) { unexpError() break;} if (strcmp(attr[0],"name")) { unexpError() break;} if ( (XMLCtx->eventCode = edg_wll_StringToEvent((char *) attr[1])) - == EDG_WLL_EVENT_UNDEF ) { unexpError() break;} + == EDG_WLL_EVENT_UNDEF ) { unexpWarning() } XMLCtx->eventsOutGlobal = realloc(XMLCtx->eventsOutGlobal, (XMLCtx->position+1)*sizeof(*XMLCtx->eventsOutGlobal)); if (!XMLCtx->eventsOutGlobal) { edg_wll_SetError(XMLCtx->ctx, ENOMEM, NULL); unexpError() return; } @@ -852,6 +852,12 @@ static void endQueryEvents(void *data, const char *el UNUSED_VAR) edg_wll_freeBuf(XMLCtx); } break; + case 2: + /* skip events of unknown type */ + if (XMLCtx->eventCode == EDG_WLL_EVENT_UNDEF) + edg_wll_FreeEvent(&(XMLCtx->eventsOutGlobal)[XMLCtx->position]); + XMLCtx->position--; + /* fallthough */ default: if (XMLCtx->char_buf) { unexpWarning() -- 1.8.2.3