Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 fricas (1.3.8-8) unstable; urgency=medium
 .
   * rewrite strcpy lines in sockio-c.c to work around fortify object size
     detection bug.  As previously written, size available in pad was
     incorrectly calculated as 14.
Author: Camm Maguire <camm@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2023-06-11

--- fricas-1.3.8.orig/src/lib/sockio-c.c
+++ fricas-1.3.8/src/lib/sockio-c.c
@@ -734,6 +734,7 @@ connect_to_local_server(char *server_nam
 {
   int max_con=(time_out == 0 ? 1000000 : time_out), i, code=-1;
   Sock *sock;
+  int j=((char *)(&(sock->addr.u_addr.sa_data))-(char *)(&(sock->addr.u_addr)));
   char name[256];
 
   make_server_name(name, server_name);
@@ -753,9 +754,7 @@ connect_to_local_server(char *server_nam
   }
   /* connect socket using name specified in command line */
   sock->addr.u_addr.sa_family = FRICAS_AF_LOCAL;
-  strcpy(sock->addr.pad +
-          ((char *)(&(sock->addr.u_addr.sa_data))
-           -(char *)(&(sock->addr.u_addr))), name);
+  strcpy(sock->addr.pad+j, name);
   for(i=0; i<max_con; i++) {
     code = connect(sock->socket, &sock->addr.u_addr,
                    sizeof(sock->addr.pad));
@@ -924,10 +923,9 @@ open_server(char *server_name)
     return -2;
   } else {
     Sock * sock = &(server[1]);
+    int j=((char *)(&(sock->addr.u_addr.sa_data))-(char *)(&(sock->addr.u_addr)));
     sock->addr.u_addr.sa_family = FRICAS_AF_LOCAL;
-    strcpy(sock->addr.pad +
-          ((char *)(&(sock->addr.u_addr.sa_data))
-           -(char *)(&(sock->addr.u_addr))), name);
+    strcpy(sock->addr.pad+j, name);
     if (bind(sock->socket, &(sock->addr.u_addr),
              sizeof(sock->addr.pad))) {
       perror("binding local server socket");
