Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -urN tokyotyrant-1.1.41.orig/ttutil.c tokyotyrant-1.1.41/ttutil.c
- --- tokyotyrant-1.1.41.orig/ttutil.c 2010-08-04 23:24:33.000000000 -0700
- +++ tokyotyrant-1.1.41/ttutil.c 2015-03-19 01:04:27.000000000 -0700
- @@ -24,7 +24,6 @@
- *************************************************************************************************/
- -#define SOCKPATHBUFSIZ 108 // size of a socket path buffer
- #define SOCKRCVTIMEO 0.25 // timeout of the recv call of socket
- #define SOCKSNDTIMEO 0.25 // timeout of the send call of socket
- #define SOCKCNCTTIMEO 5.0 // timeout of the connect call of socket
- @@ -127,7 +126,7 @@
- struct sockaddr_un saun;
- memset(&saun, 0, sizeof(saun));
- saun.sun_family = AF_UNIX;
- - snprintf(saun.sun_path, SOCKPATHBUFSIZ, "%s", path);
- + strncpy(saun.sun_path, path, sizeof(saun.sun_path)-1);
- int fd = socket(PF_UNIX, SOCK_STREAM, 0);
- if(fd == -1) return -1;
- int optint = 1;
- @@ -187,7 +186,7 @@
- struct sockaddr_un saun;
- memset(&saun, 0, sizeof(saun));
- saun.sun_family = AF_UNIX;
- - snprintf(saun.sun_path, SOCKPATHBUFSIZ, "%s", path);
- + strncpy(saun.sun_path, path, sizeof(saun.sun_path)-1);
- int fd = socket(PF_UNIX, SOCK_STREAM, 0);
- if(fd == -1) return -1;
- if(bind(fd, (struct sockaddr *)&saun, sizeof(saun)) != 0 ||
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement