Package: libwebsockets
Version: 4.3.5-3
Followup-For: Bug #1128683
X-Debbugs-Cc: [email protected]
User: [email protected]
Usertags: origin-ubuntu resolute ubuntu-patch
Control: tags -1 patch

Dear maintainer(s),

In Ubuntu, the attached patch was applied to successfully fix the FTBFS.

Link to successful build log:
https://launchpadlibrarian.net/849952280/buildlog_ubuntu-resolute-amd64.libwebsockets_4.3.5-3ubuntu1~ppa1_BUILDING.txt.gz

The attached patch is a cherry-pick from upstream here:
https://github.com/warmcat/libwebsockets/commit/54e67208976494a4a2235f2e0fc959d46bcb7452

Thanks for considering the patch.
diff -Nru 
libwebsockets-4.3.5/debian/patches/0004-c23-fix-initialization-discards-const-qualifier-from.patch
 
libwebsockets-4.3.5/debian/patches/0004-c23-fix-initialization-discards-const-qualifier-from.patch
--- 
libwebsockets-4.3.5/debian/patches/0004-c23-fix-initialization-discards-const-qualifier-from.patch
  1969-12-31 16:00:00.000000000 -0800
+++ 
libwebsockets-4.3.5/debian/patches/0004-c23-fix-initialization-discards-const-qualifier-from.patch
  2026-03-02 18:34:42.000000000 -0800
@@ -0,0 +1,111 @@
+From: Rudi Heitbaum <[email protected]>
+Date: Mon, 26 Jan 2026 02:13:40 +0000
+Subject: c23: fix initialization discards const qualifier from pointer target
+ type
+
+Origin: 
https://github.com/warmcat/libwebsockets/commit/54e67208976494a4a2235f2e0fc959d46bcb7452
+Bug-Ubuntu: https://launchpad.net/bugs/2142896
+Bug-Debian: https://bugs.debian.org/1128683
+
+Description: 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.
+
+https://lists.gnu.org/archive/html/info-gnu/2026-01/msg00005.html
+
+Signed-off-by: Rudi Heitbaum <[email protected]>
+---
+ lib/core-net/client/client.c   | 11 ++++++-----
+ lib/plat/unix/unix-caps.c      |  3 ++-
+ lib/roles/http/cookie.c        |  3 ++-
+ lib/roles/http/server/server.c |  3 ++-
+ 4 files changed, 12 insertions(+), 8 deletions(-)
+
+diff --git a/lib/core-net/client/client.c b/lib/core-net/client/client.c
+index e3bc6d5..2a3b69e 100644
+--- a/lib/core-net/client/client.c
++++ b/lib/core-net/client/client.c
+@@ -31,7 +31,7 @@ lws_set_proxy(struct lws_vhost *vhost, const char *proxy)
+ {
+       char authstring[96];
+       int brackets = 0;
+-      char *p;
++      const char *p;
+ 
+       if (!proxy)
+               return -1;
+@@ -84,15 +84,17 @@ lws_set_proxy(struct lws_vhost *vhost, const char *proxy)
+ 
+ #if defined(LWS_WITH_IPV6)
+       if (brackets) {
++              char *ncp;
++
+               /* original is IPv6 format "[::1]:443" */
+ 
+-              p = strchr(vhost->http.http_proxy_address, ']');
+-              if (!p) {
++              ncp = strchr(vhost->http.http_proxy_address, ']');
++              if (!ncp) {
+                       lwsl_vhost_err(vhost, "malformed proxy '%s'", proxy);
+ 
+                       return -1;
+               }
+-              *p++ = '\0';
++              *ncp++ = '\0';
+       }
+ #endif
+ 
+@@ -103,7 +105,6 @@ lws_set_proxy(struct lws_vhost *vhost, const char *proxy)
+               return -1;
+       }
+       if (p) {
+-              *p = '\0';
+               vhost->http.http_proxy_port = (unsigned int)atoi(p + 1);
+       }
+ 
+diff --git a/lib/plat/unix/unix-caps.c b/lib/plat/unix/unix-caps.c
+index 2f38854..0897a5e 100644
+--- a/lib/plat/unix/unix-caps.c
++++ b/lib/plat/unix/unix-caps.c
+@@ -51,7 +51,8 @@ _lws_plat_apply_caps(unsigned int mode, const cap_value_t 
*cv, int count)
+ int
+ lws_plat_user_colon_group_to_ids(const char *u_colon_g, uid_t *puid, gid_t 
*pgid)
+ {
+-      char *colon = strchr(u_colon_g, ':'), u[33];
++      const char *colon = strchr(u_colon_g, ':');
++      char u[33];
+       struct group *g;
+       struct passwd *p;
+       size_t ulen;
+diff --git a/lib/roles/http/cookie.c b/lib/roles/http/cookie.c
+index 44ad6eb..1347f6f 100644
+--- a/lib/roles/http/cookie.c
++++ b/lib/roles/http/cookie.c
+@@ -286,7 +286,8 @@ lws_cookie_write_nsc(struct lws *wsi, struct lws_cookie *c)
+       const char *ads, *path;
+       struct lws_cache_ttl_lru *l1;
+       struct client_info_stash *stash;
+-      char *cookie_string = NULL, *dl;
++      char *cookie_string = NULL;
++      const char *dl;
+        /* 6 tabs + 20 for max time_t + 2 * TRUE/FALSE + null */
+       size_t size = 6 + 20 + 10 + 1;
+       time_t expires = 0;
+diff --git a/lib/roles/http/server/server.c b/lib/roles/http/server/server.c
+index 76e2ad6..e75658a 100644
+--- a/lib/roles/http/server/server.c
++++ b/lib/roles/http/server/server.c
+@@ -2289,7 +2289,8 @@ raw_transition:
+               if (wsi->a.context->reject_service_keywords) {
+                       const struct lws_protocol_vhost_options *rej =
+                                       wsi->a.context->reject_service_keywords;
+-                      char ua[384], *msg = NULL;
++                      char ua[384];
++                      const char *msg = NULL;
+ 
+                       if (lws_hdr_copy(wsi, ua, sizeof(ua) - 1,
+                                        WSI_TOKEN_HTTP_USER_AGENT) > 0) {
diff -Nru libwebsockets-4.3.5/debian/patches/series 
libwebsockets-4.3.5/debian/patches/series
--- libwebsockets-4.3.5/debian/patches/series   2025-10-27 10:31:12.000000000 
-0700
+++ libwebsockets-4.3.5/debian/patches/series   2026-03-02 18:34:42.000000000 
-0800
@@ -1,3 +1,4 @@
 cmake_update.patch
 CVE-2025-11677.patch
 CVE-2025-11678.patch
+0004-c23-fix-initialization-discards-const-qualifier-from.patch

Reply via email to