backport another patch relating to new gcc versions
@@ -20,6 +20,37 @@ index 7d54160..5a51708 100644
let fail,jmps =
scan_def
[]
+diff --git a/byterun/debugger.c b/byterun/debugger.c
+index 5e61584..55ccf62 100644
+--- a/byterun/debugger.c
++++ b/byterun/debugger.c
+@@ -161,6 +161,7 @@ static void winsock_cleanup(void)
+ void caml_debugger_init(void)
+ {
+ char * address;
++ size_t a_len;
+ char * port, * p;
+ struct hostent * host;
+ int n;
+@@ -188,11 +189,16 @@ void caml_debugger_init(void)
+ /* Unix domain */
+ sock_domain = PF_UNIX;
+ sock_addr.s_unix.sun_family = AF_UNIX;
++ a_len = strlen(address);
++ if (a_len >= sizeof(sock_addr.s_unix.sun_path)) {
++ caml_fatal_error("Debug socket path length exceeds maximum permitted length");
++ }
+ strncpy(sock_addr.s_unix.sun_path, address,
+- sizeof(sock_addr.s_unix.sun_path));
++ sizeof(sock_addr.s_unix.sun_path) - 1);
++ sock_addr.s_unix.sun_path[sizeof(sock_addr.s_unix.sun_path) - 1] = '\0';
+ sock_addr_len =
+ ((char *)&(sock_addr.s_unix.sun_path) - (char *)&(sock_addr.s_unix))
+- + strlen(address);
++ + a_len;
+ #else
+ caml_fatal_error("Unix sockets not supported");
+ #endif
diff --git a/byterun/signals.c b/byterun/signals.c
index 5c4e261..085f5f0 100644
--- a/byterun/signals.c
