From ff37642ad86a3d5bcd87905ea4ac27d7fc364584 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sun, 27 Jan 2019 03:00:52 +0100 Subject: activation: Fix parsing of description from buddyml response --- src/activation.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/activation.c b/src/activation.c index 3018d0a..34ea741 100644 --- a/src/activation.c +++ b/src/activation.c @@ -314,11 +314,17 @@ static idevice_activation_error_t idevice_activation_parse_buddyml_response(idev xmlXPathFreeObject(xpath_result); xpath_result = NULL; } - xpath_result = xmlXPathEvalExpression((const xmlChar*) "/xmlui/page/tableView/section[@footer and not(@footerLinkURL)]/@footer", context); + xpath_result = xmlXPathEvalExpression((const xmlChar*) "/xmlui/page/tableView/section/footer[not (@url)]", context); if (!xpath_result) { result = IDEVICE_ACTIVATION_E_INTERNAL_ERROR; goto cleanup; } + if (!xpath_result->nodesetval) { + xmlXPathFreeObject(xpath_result); + xpath_result = xmlXPathEvalExpression((const xmlChar*) "/xmlui/page/tableView/section[@footer and not(@footerLinkURL)]/@footer", context); + result = IDEVICE_ACTIVATION_E_INTERNAL_ERROR; + goto cleanup; + } if (xpath_result->nodesetval) { char* response_description = (char*) malloc(sizeof(char)); @@ -348,6 +354,7 @@ static idevice_activation_error_t idevice_activation_parse_buddyml_response(idev xmlXPathFreeObject(xpath_result); xpath_result = NULL; } + xpath_result = xmlXPathEvalExpression((const xmlChar*) "/xmlui/page//editableTextRow", context); if (!xpath_result) { result = IDEVICE_ACTIVATION_E_INTERNAL_ERROR; -- cgit v1.1-32-gdbae