If passed binPath argument is longer than MAXPATHLEN, we will write
passed the buffer. This patch fixes it.
short port = 0;
char host[MAXPATHLEN];
+ if (strlen(bindPath) >= MAXPATHLEN) {
+ fprintf(stderr,
+ "Listening socket path is longer than %d bytes -- exiting!\n",
+ MAXPATHLEN);
+ exit(1);
+ }
strcpy(host, bindPath);
if((tp = strchr(host, ':')) != 0) {
*tp++ = 0;
short port = 0;
int tcp = FALSE;
+ if (strlen(bindPath) >= MAXPATHLEN) {
+ fprintf(stderr, "Listening socket path is too long\n");
+ exit(1000);
+ }
strcpy(host, bindPath);
if((tp = strchr(host, ':')) != 0) {
*tp++ = 0;