tcp-wrappers-7.6-redhat-bug11881.patch 956 B

123456789101112131415161718192021222324252627282930313233343536
  1. --- tcp_wrappers_7.6/tcpd.c.bug11881
  2. +++ tcp_wrappers_7.6/tcpd.c
  3. @@ -60,10 +60,10 @@
  4. */
  5. if (argv[0][0] == '/') {
  6. - strcpy(path, argv[0]);
  7. + strncpy(path, argv[0], sizeof(path));
  8. argv[0] = strrchr(argv[0], '/') + 1;
  9. } else {
  10. - sprintf(path, "%s/%s", REAL_DAEMON_DIR, argv[0]);
  11. + snprintf(path, sizeof(path), "%s/%s", REAL_DAEMON_DIR, argv[0]);
  12. }
  13. /*
  14. --- tcp_wrappers_7.6/eval.c.bug11881
  15. +++ tcp_wrappers_7.6/eval.c
  16. @@ -111,7 +111,7 @@
  17. return (hostinfo);
  18. #endif
  19. if (STR_NE(eval_user(request), unknown)) {
  20. - sprintf(both, "%s@%s", request->user, hostinfo);
  21. + snprintf(both, sizeof(both), "%s@%s", request->user, hostinfo);
  22. return (both);
  23. } else {
  24. return (hostinfo);
  25. @@ -128,7 +128,7 @@
  26. char *daemon = eval_daemon(request);
  27. if (STR_NE(host, unknown)) {
  28. - sprintf(both, "%s@%s", daemon, host);
  29. + snprintf(both, sizeof(both), "%s@%s", daemon, host);
  30. return (both);
  31. } else {
  32. return (daemon);