From: František Dvořák Date: Mon, 28 Jun 2010 18:54:19 +0000 (+0000) Subject: Check for NULL before parsing purge request (needed for expat < 2.0). Fixes crash... X-Git-Tag: glite-lb-types_R_1_1_1_1_emi_0~7 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=3732b43333754108039c96e7f535d2983945fe5f;p=jra1mw.git Check for NULL before parsing purge request (needed for expat < 2.0). Fixes crash in purge utility on strange jobid list. --- diff --git a/org.glite.lb.common/src/xml_parse.c.T b/org.glite.lb.common/src/xml_parse.c.T index 797c9e6..c17d35e 100644 --- a/org.glite.lb.common/src/xml_parse.c.T +++ b/org.glite.lb.common/src/xml_parse.c.T @@ -1982,6 +1982,9 @@ edg_wll_ErrorCode edg_wll_ParsePurgeResult(edg_wll_Context ctx, char *messageBod edg_wll_ErrorCode errorCode; XML_Char *encoding = "ISO-8859-1"; + if (!messageBody) + return edg_wll_SetError(ctx, EDG_WLL_ERROR_XML_PARSE, "Parse error: empty response"); + errno = 0; edg_wll_ResetError(ctx); edg_wll_initXMLCtx(&XMLCtx); @@ -2052,6 +2055,9 @@ edg_wll_ErrorCode edg_wll_ParseDumpResult(edg_wll_Context ctx, char *messageBody edg_wll_ErrorCode errorCode; XML_Char *encoding = "ISO-8859-1"; + if (!messageBody) + return edg_wll_SetError(ctx, EDG_WLL_ERROR_XML_PARSE, "Parse error: empty response"); + errno = 0; edg_wll_ResetError(ctx); edg_wll_initXMLCtx(&XMLCtx); @@ -2114,6 +2120,9 @@ edg_wll_ErrorCode edg_wll_ParseLoadResult(edg_wll_Context ctx, char *messageBody edg_wll_ErrorCode errorCode; XML_Char *encoding = "ISO-8859-1"; + if (!messageBody) + return edg_wll_SetError(ctx, EDG_WLL_ERROR_XML_PARSE, "Parse error: empty response"); + errno = 0; edg_wll_ResetError(ctx); edg_wll_initXMLCtx(&XMLCtx); @@ -2250,6 +2259,9 @@ edg_wll_ErrorCode edg_wll_ParseNotifResult(edg_wll_Context ctx, char *messageBod edg_wll_ErrorCode errorCode; XML_Char *encoding = "ISO-8859-1"; + if (!messageBody) + return edg_wll_SetError(ctx, EDG_WLL_ERROR_XML_PARSE, "Parse error: empty response"); + errno = 0; edg_wll_ResetError(ctx); edg_wll_initXMLCtx(&XMLCtx); @@ -2311,6 +2323,9 @@ edg_wll_ErrorCode edg_wll_ParseQuerySequenceCodeResult(edg_wll_Context ctx, char edg_wll_ErrorCode errorCode; XML_Char *encoding = "ISO-8859-1"; + if (!messageBody) + return edg_wll_SetError(ctx, EDG_WLL_ERROR_XML_PARSE, "Parse error: empty response"); + errno = 0; edg_wll_ResetError(ctx); edg_wll_initXMLCtx(&XMLCtx); @@ -2373,6 +2388,9 @@ edg_wll_ErrorCode edg_wll_ParseStatsResult(edg_wll_Context ctx, char *messageBod edg_wll_ErrorCode errorCode; XML_Char *encoding = "ISO-8859-1"; + if (!messageBody) + return edg_wll_SetError(ctx, EDG_WLL_ERROR_XML_PARSE, "Parse error: empty response"); + errno = 0; edg_wll_ResetError(ctx); edg_wll_initXMLCtx(&XMLCtx);