]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
ntlm: fix discards 'const' qualifier from pointer target type
authorRudi Heitbaum <rudi@heitbaum.com>
Wed, 18 Feb 2026 21:44:31 +0000 (22:44 +0100)
committerGert Doering <gert@greenie.muc.de>
Thu, 19 Feb 2026 12:07:31 +0000 (13:07 +0100)
Since glibc-2.43:

For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return pointers
into their input arrays now have definitions as macros that return a
pointer to a const-qualified type when the input argument is a pointer
to a const-qualified type.

fixes:
    src/openvpn/ntlm.c: In function 'ntlm_phase_3':
    src/openvpn/ntlm.c:241:15: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
      241 |     separator = strchr(p->up.username, '\\');
          |               ^

Change-Id: I2703f15144661f9cadfc8750884db270f3a5bfc6
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1546
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Message-Id: <20260218214437.26912-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35723.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit b5087dcf3fe3d4aa226dd3e727991bfe8a3a5efb)

src/openvpn/ntlm.c

index 8e913dcea2e241b0b6b9635c57dd58e89a7a474d..244ee945b5a6120b63a84c5fd39eeb8f0a437c76 100644 (file)
@@ -218,7 +218,7 @@ ntlm_phase_3(const struct http_proxy_info *p, const char *phase_2, struct gc_are
 
     char domain[128];
     char username[128];
-    char *separator;
+    const char *separator;
 
     ASSERT(strlen(p->up.username) > 0);
     ASSERT(strlen(p->up.password) > 0);