From 2493c2972f89382e9d7fe0b77f94745d8077ba21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zden=C4=9Bk=20Salvet?= Date: Mon, 13 Aug 2007 11:24:18 +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 418af9e..c2c6af1 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; } @@ -848,6 +848,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