wok-next view libwrap/stuff/tcp-wrappers-redhat-bug11881.patch @ rev 21153
Small updates.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Thu Jan 31 16:45:41 2019 +0200 (2019-01-31) |
parents | |
children |
line source
1 --- tcp_wrappers_7.6/tcpd.c.bug11881
2 +++ tcp_wrappers_7.6/tcpd.c
3 @@ -60,10 +60,10 @@
4 */
6 if (argv[0][0] == '/') {
7 - strcpy(path, argv[0]);
8 + strncpy(path, argv[0], sizeof(path));
9 argv[0] = strrchr(argv[0], '/') + 1;
10 } else {
11 - sprintf(path, "%s/%s", REAL_DAEMON_DIR, argv[0]);
12 + snprintf(path, sizeof(path), "%s/%s", REAL_DAEMON_DIR, argv[0]);
13 }
15 /*
16 --- tcp_wrappers_7.6/eval.c.bug11881
17 +++ tcp_wrappers_7.6/eval.c
18 @@ -111,7 +111,7 @@
19 return (hostinfo);
20 #endif
21 if (STR_NE(eval_user(request), unknown)) {
22 - sprintf(both, "%s@%s", request->user, hostinfo);
23 + snprintf(both, sizeof(both), "%s@%s", request->user, hostinfo);
24 return (both);
25 } else {
26 return (hostinfo);
27 @@ -128,7 +128,7 @@
28 char *daemon = eval_daemon(request);
30 if (STR_NE(host, unknown)) {
31 - sprintf(both, "%s@%s", daemon, host);
32 + snprintf(both, sizeof(both), "%s@%s", daemon, host);
33 return (both);
34 } else {
35 return (daemon);