]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
mbedtls: fix incorrect macro condition mbed_dump_cert_info
authorJan Venekamp <1422460+jan2000@users.noreply.github.com>
Tue, 20 Aug 2024 18:33:59 +0000 (20:33 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 21 Aug 2024 05:50:31 +0000 (07:50 +0200)
Follow-up to 88cae145509c7

lib/vtls/mbedtls.c

index 1cf7c0469760a570d9e81556abc9d123ef25abfe..1c00cbe1d7ac25eeee4a4e7cb8ed8549ea0de065 100644 (file)
@@ -488,7 +488,7 @@ add_ciphers:
 static void
 mbed_dump_cert_info(struct Curl_easy *data, const mbedtls_x509_crt *crt)
 {
-#if !defined(CURL_DISABLE_VERBOSE_STRINGS) || \
+#if defined(CURL_DISABLE_VERBOSE_STRINGS) || \
     (MBEDTLS_VERSION_NUMBER >= 0x03000000 && defined(MBEDTLS_X509_REMOVE_INFO))
   (void) data, (void) crt;
 #else
@@ -497,7 +497,7 @@ mbed_dump_cert_info(struct Curl_easy *data, const mbedtls_x509_crt *crt)
 
   if(buffer && mbedtls_x509_crt_info(buffer, bufsize, " ", crt) > 0) {
     infof(data, "Server certificate:");
-    for(p = buffer; *p; *p && p++) {
+    for(p = buffer; *p; p += *p != '\0') {
       size_t s = strcspn(p, "\n");
       infof(data, "%.*s", (int) s, p);
       p += s;