mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[core,arm] fix optional string redirectedUsername
json-c does return NULL from WINPR_JSON_GetObjectItemCaseSensitive if the value is NULL, so do a check with WINPR_JSON_HasObjectItem first.
This commit is contained in:
@@ -899,12 +899,17 @@ static BOOL arm_fill_gateway_parameters(rdpArm* arm, const char* message, size_t
|
||||
}
|
||||
}
|
||||
|
||||
WINPR_JSON* userNameNode = WINPR_JSON_GetObjectItemCaseSensitive(json, "redirectedUserName");
|
||||
if (userNameNode)
|
||||
{
|
||||
const char* userName = WINPR_JSON_GetStringValue(userNameNode);
|
||||
if (!freerdp_settings_set_string(settings, FreeRDP_Username, userName))
|
||||
goto fail;
|
||||
const char key[] = "redirectedUsername";
|
||||
if (WINPR_JSON_HasObjectItem(json, key))
|
||||
{
|
||||
const char* userName = NULL;
|
||||
WINPR_JSON* userNameNode = WINPR_JSON_GetObjectItemCaseSensitive(json, key);
|
||||
if (userNameNode)
|
||||
userName = WINPR_JSON_GetStringValue(userNameNode);
|
||||
if (!freerdp_settings_set_string(settings, FreeRDP_Username, userName))
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
WINPR_JSON* azureMeta =
|
||||
|
||||
Reference in New Issue
Block a user