Greetings!  

make_server_name in sockio-c.pamphlet makes a name that can be larger
than the sa_data field of the BSD sockaddr structure and overflow the
buffer, which is only 14 bytes long.  You might want to consider
sockaddr_un.

This was uncovered on ppc64 using FORTIFY_SOURCE=2.  A crude
workaround is included below, but it can surely be made better.

Take care,
=============================================================================
int 
make_server_name(char *name,char * base)
{
  char *num;
  struct sockaddr addr;
  if (spad_server_number != -1) {
    snprintf(name, sizeof(addr.sa_data),"%s%d", base, spad_server_number);
    return 0;
  }
  num = getenv("SPADNUM");
  if (num == NULL) {
/*    fprintf(stderr,
      "\n(AXIOM Sockets) The AXIOM server number is undefined.\n");
*/
    return -1;
  }
  snprintf(name, sizeof(addr.sa_data),"%s%s", base, num);
  return 0;
}
=============================================================================
-- 
Camm Maguire                                        [email protected]
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah

_______________________________________________
Axiom-developer mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/axiom-developer

Reply via email to