Skip to content

Commit cbfaf63

Browse files
author
thimmegowni.venkatesu
committed
fix: correct OAuth URL size calculation in Azure Kusto configuration
Signed-off-by: thimmegowni.venkatesu <[email protected]>
1 parent 7e65d49 commit cbfaf63

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

plugins/out_azure_kusto/azure_kusto.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ static int azure_kusto_get_service_principal_token(struct flb_azure_kusto *ctx)
8383
}
8484

8585
/* scope depends on cloud environment */
86-
const char *scope = flb_azure_kusto_get_scope(ctx->cloud_environment);
87-
ret = flb_oauth2_payload_append(ctx->o, "scope", 5, scope, strlen(scope));
86+
const char *scope = flb_azure_kusto_get_scope(ctx->cloud_environment);
87+
ret = flb_oauth2_payload_append(ctx->o, "scope", 5, scope, strlen(scope));
8888

8989
if (ret == -1) {
9090
flb_plg_error(ctx->ins, "error appending oauth2 params");

plugins/out_azure_kusto/azure_kusto_conf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ struct flb_azure_kusto *flb_azure_kusto_conf_create(struct flb_output_instance *
857857
} else {
858858
/* Standard OAuth2 for service principal or workload identity */
859859
const char *tmpl = get_msal_auth_url_template(ctx->cloud_environment);
860-
ctx->oauth_url = flb_sds_create_size(sizeof(tmpl) - 1 + flb_sds_len(ctx->tenant_id));
860+
ctx->oauth_url = flb_sds_create_size(strlen(tmpl) + flb_sds_len(ctx->tenant_id) + 1);
861861
if (!ctx->oauth_url) {
862862
flb_errno();
863863
flb_azure_kusto_conf_destroy(ctx);

0 commit comments

Comments
 (0)