]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
krb5: fix `-Wcast-align`
authorViktor Szakats <commit@vsz.me>
Wed, 7 Aug 2024 02:27:49 +0000 (04:27 +0200)
committerViktor Szakats <commit@vsz.me>
Wed, 7 Aug 2024 13:13:07 +0000 (15:13 +0200)
```
lib/krb5.c:343:39: warning: cast from 'void **' to 'unsigned char **' increases required alignment from 2 to 8 [-Wcast-align]
                               (unsigned char **)&_gssresp.value,
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Seen on macOS Intel with Apple clang and brew heimdal 7.8.0_1.

Closes #14433

lib/krb5.c

index 7bc2f00ec80ae112e859bd678ccea619d8b7aafa..f3649cd1aba4a56b416405a97031ba22e21d66b0 100644 (file)
@@ -336,17 +336,20 @@ krb5_auth(void *app_data, struct Curl_easy *data, struct connectdata *conn)
         }
 
         _gssresp.value = NULL; /* make sure it is initialized */
+        _gssresp.length = 0;
         p += 4; /* over '789 ' */
         p = strstr(p, "ADAT=");
         if(p) {
-          result = Curl_base64_decode(p + 5,
-                                      (unsigned char **)&_gssresp.value,
-                                      &_gssresp.length);
+          unsigned char *outptr;
+          size_t outlen;
+          result = Curl_base64_decode(p + 5, &outptr, &outlen);
           if(result) {
             failf(data, "base64-decoding: %s", curl_easy_strerror(result));
             ret = AUTH_CONTINUE;
             break;
           }
+          _gssresp.value = outptr;
+          _gssresp.length = outlen;
         }
 
         gssresp = &_gssresp;