From: Stephan Bosch Date: Fri, 21 Feb 2025 16:54:48 +0000 (+0100) Subject: lib-sasl: mech-oauthbearer - Use container_of() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=07763eb918da222a655696f3e7bf48faa230d456;p=thirdparty%2Fdovecot%2Fcore.git lib-sasl: mech-oauthbearer - Use container_of() --- diff --git a/src/lib-sasl/mech-oauthbearer.c b/src/lib-sasl/mech-oauthbearer.c index cf2725ce16..db756debf4 100644 --- a/src/lib-sasl/mech-oauthbearer.c +++ b/src/lib-sasl/mech-oauthbearer.c @@ -21,7 +21,7 @@ mech_oauthbearer_input(struct dsasl_client *_client, const char **error_r) { struct oauthbearer_dsasl_client *client = - (struct oauthbearer_dsasl_client *)_client; + container_of(_client, struct oauthbearer_dsasl_client, client); if (!client->output_sent) { if (input_len > 0) { @@ -93,7 +93,7 @@ mech_oauthbearer_output(struct dsasl_client *_client, const char **error_r) { struct oauthbearer_dsasl_client *client = - (struct oauthbearer_dsasl_client *)_client; + container_of(_client, struct oauthbearer_dsasl_client, client); string_t *str; if (_client->set.authid == NULL) { @@ -156,7 +156,7 @@ mech_oauthbearer_set_parameter(struct dsasl_client *_client, const char *key, const char *value, const char **error_r) { struct oauthbearer_dsasl_client *client = - (struct oauthbearer_dsasl_client *)_client; + container_of(_client, struct oauthbearer_dsasl_client, client); if (strcmp(key, "host") == 0) { if (value != NULL) @@ -182,7 +182,7 @@ mech_oauthbearer_get_result(struct dsasl_client *_client, const char *key, const char **error_r ATTR_UNUSED) { struct oauthbearer_dsasl_client *client = - (struct oauthbearer_dsasl_client *)_client; + container_of(_client, struct oauthbearer_dsasl_client, client); if (strcmp(key, "status") == 0) { /* this is set to value after login attempt */