diff --git a/libfreerdp/core/aad.c b/libfreerdp/core/aad.c index 242891751..179003d6b 100644 --- a/libfreerdp/core/aad.c +++ b/libfreerdp/core/aad.c @@ -244,7 +244,8 @@ static BOOL aad_get_nonce(rdpAad* aad) json = WINPR_JSON_ParseWithLength((const char*)response, response_length); if (!json) { - WLog_Print(aad->log, WLOG_ERROR, "Failed to parse nonce response"); + WLog_Print(aad->log, WLOG_ERROR, "Failed to parse nonce response: %s", + WINPR_JSON_GetErrorPtr()); goto fail; } @@ -536,7 +537,11 @@ static int aad_parse_state_initial(rdpAad* aad, wStream* s) json = WINPR_JSON_ParseWithLength(jstr, jlen); if (!json) + { + WLog_Print(aad->log, WLOG_ERROR, "WINPR_JSON_ParseWithLength failed: %s", + WINPR_JSON_GetErrorPtr()); goto fail; + } if (!json_get_const_string(aad->log, json, "ts_nonce", &ts_nonce)) goto fail; @@ -561,7 +566,11 @@ static int aad_parse_state_auth(rdpAad* aad, wStream* s) json = WINPR_JSON_ParseWithLength(jstr, jlength); if (!json) + { + WLog_Print(aad->log, WLOG_ERROR, "WINPR_JSON_ParseWithLength: %s", + WINPR_JSON_GetErrorPtr()); goto fail; + } if (!json_get_number(aad->log, json, "authentication_result", &result)) goto fail; @@ -851,8 +860,9 @@ char* freerdp_utils_aad_get_access_token(wLog* log, const char* data, size_t len WINPR_JSON* json = WINPR_JSON_ParseWithLength(data, length); if (!json) { - WLog_Print(log, WLOG_ERROR, "Failed to parse access token response [got %" PRIuz " bytes", - length); + WLog_Print(log, WLOG_ERROR, + "Failed to parse access token response [got %" PRIuz " bytes: %s", length, + WINPR_JSON_GetErrorPtr()); goto cleanup; } @@ -1026,7 +1036,8 @@ WINPR_JSON* freerdp_utils_aad_get_wellknown(wLog* log, const char* base, const c free(response); if (!json) - WLog_Print(log, WLOG_ERROR, "failed to parse response as JSON"); + WLog_Print(log, WLOG_ERROR, "failed to parse response as JSON: %s", + WINPR_JSON_GetErrorPtr()); return json; } diff --git a/libfreerdp/core/gateway/arm.c b/libfreerdp/core/gateway/arm.c index c14ec11df..12264318a 100644 --- a/libfreerdp/core/gateway/arm.c +++ b/libfreerdp/core/gateway/arm.c @@ -954,7 +954,8 @@ static BOOL arm_fill_gateway_parameters(rdpArm* arm, const char* message, size_t BOOL status = FALSE; if (!json) { - WLog_Print(arm->log, WLOG_ERROR, "Response data is not valid JSON"); + WLog_Print(arm->log, WLOG_ERROR, "Response data is not valid JSON: %s", + WINPR_JSON_GetErrorPtr()); return FALSE; } @@ -1078,8 +1079,7 @@ static BOOL arm_handle_bad_request(rdpArm* arm, const HttpResponse* response, BO if (json == NULL) { const char* error_ptr = WINPR_JSON_GetErrorPtr(); - if (error_ptr != NULL) - WLog_Print(arm->log, WLOG_ERROR, "NullPoException: %s", error_ptr); + WLog_Print(arm->log, WLOG_ERROR, "WINPR_JSON_ParseWithLength: %s", error_ptr); return FALSE; }