changeset 6329:e7e47f3188b8

fix compatibility with ansi c
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 23 Sep 2025 22:15:43 +0200
parents 5ea89eb7ba8f
children 594d3fe48be3
files OrthancFramework/Resources/Patches/civetweb-1.16.patch
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Resources/Patches/civetweb-1.16.patch	Tue Sep 23 21:11:09 2025 +0200
+++ b/OrthancFramework/Resources/Patches/civetweb-1.16.patch	Tue Sep 23 22:15:43 2025 +0200
@@ -1,6 +1,6 @@
 diff -urEb civetweb-1.16.orig/src/civetweb.c civetweb-1.16/src/civetweb.c
 --- civetweb-1.16.orig/src/civetweb.c	2025-09-23 15:37:44.946300709 +0200
-+++ civetweb-1.16/src/civetweb.c	2025-09-23 16:05:20.877342193 +0200
++++ civetweb-1.16/src/civetweb.c	2025-09-23 22:13:44.809084369 +0200
 @@ -573,7 +573,7 @@
  #if (_MSC_VER < 1300)
  #define STRX(x) #x
@@ -33,14 +33,16 @@
  
  
  #else /* USE_SERVER_STATS */
-@@ -15255,12 +15255,28 @@
+@@ -15254,13 +15254,30 @@
+ 		if (!new_path) {
  			mg_send_http_error(conn, 500, "out or memory");
  		} else {
++                        /* Start of patch for CVE-2025-55763: https://github.com/civetweb/civetweb/pull/1347 */
++                        size_t len, max_append;
  			mg_get_request_link(conn, new_path, buflen - 1);
 -			strcat(new_path, "/");
 +
-+                        /* Start of patch for CVE-2025-55763: https://github.com/civetweb/civetweb/pull/1347 */
-+                        size_t len = strlen(new_path);
++                        len = strlen(new_path);
 +                        if (len + 1 < buflen) {
 +                          new_path[len] = '/';
 +                          new_path[len + 1] = '\0';
@@ -58,7 +60,7 @@
  			}
 +
 +                          /* Append with size of space left for query string + null terminator */
-+                          size_t max_append = buflen - len - 1;
++                          max_append = buflen - len - 1;
 +                          strncat(new_path, ri->query_string, max_append);
 +                        }
 +                        /* End of patch */