openbsd-ports/mail/dspam/patches/patch-src_util_c

31 lines
847 B
Plaintext

$OpenBSD: patch-src_util_c,v 1.2 2005/11/23 08:52:49 jakob Exp $
--- src/util.c.orig Wed Oct 26 19:39:32 2005
+++ src/util.c Tue Nov 8 16:13:59 2005
@@ -278,7 +278,7 @@ const char * _ds_userdir_path (char *pat
#endif
if (p == NULL)
- strcpy(userhome, home);
+ strlcpy(userhome, home, sizeof(userhome));
else
strlcpy(userhome, p->pw_dir, sizeof(userhome));
@@ -307,7 +307,7 @@ const char * _ds_userdir_path (char *pat
free(f);
#else
strlcpy(username, filename, MAX_FILENAME_LENGTH);
- strcpy(userpath, username);
+ strlcpy(userpath, username, sizeof (userpath));
#endif
/* Use home/opt-in/ and home/opt-out/ to store opt files, instead of
@@ -748,6 +748,7 @@ inet_ntoa_r(struct in_addr in, char *buf
return(NULL);
}
- return strcpy(buf, b);
+ strlcpy(buf, b, len);
+ return buf;
}
#endif