summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xtranssock.c3
-rw-r--r--Xtransutil.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/Xtranssock.c b/Xtranssock.c
index 1282ed3..07dc297 100644
--- a/Xtranssock.c
+++ b/Xtranssock.c
@@ -1100,7 +1100,8 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
return TRANS_CREATE_LISTENER_FAILED;
}
} else {
- sprintf (sockname.sun_path, "%s%ld", UNIX_PATH, (long)getpid());
+ snprintf (sockname.sun_path, sizeof(sockname.sun_path),
+ "%s%ld", UNIX_PATH, (long)getpid());
}
#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) && !defined(Lynx)
diff --git a/Xtransutil.c b/Xtransutil.c
index 253e8b0..cc57193 100644
--- a/Xtransutil.c
+++ b/Xtransutil.c
@@ -300,7 +300,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr)
#endif
portnum = ntohs (saddr->sin_port);
- sprintf (portnumbuf, "%d", portnum);
+ snprintf (portnumbuf, sizeof(portnumbuf), "%d", portnum);
networkId = (char *) xalloc (3 + strlen (transName) +
strlen (hostnamebuf) + strlen (portnumbuf));
sprintf (networkId, "%s/%s:%s", transName, hostnamebuf, portnumbuf);