2007-12-21 09:42:23 -05:00
|
|
|
$OpenBSD: patch-src_util_c,v 1.3 2007/12/21 14:42:23 todd Exp $
|
|
|
|
--- src/util.c.orig Sat May 13 03:12:59 2006
|
|
|
|
+++ src/util.c Sun Apr 29 17:57:52 2007
|
|
|
|
@@ -278,7 +278,7 @@ const char * _ds_userdir_path (char *path, const char
|
2005-10-26 02:18:38 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
if (p == NULL)
|
|
|
|
- strcpy(userhome, home);
|
|
|
|
+ strlcpy(userhome, home, sizeof(userhome));
|
|
|
|
else
|
|
|
|
strlcpy(userhome, p->pw_dir, sizeof(userhome));
|
|
|
|
|
2007-12-21 09:42:23 -05:00
|
|
|
@@ -307,7 +307,7 @@ const char * _ds_userdir_path (char *path, const char
|
2005-10-26 02:18:38 -04:00
|
|
|
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
|
2007-12-21 09:42:23 -05:00
|
|
|
@@ -748,6 +748,7 @@ inet_ntoa_r(struct in_addr in, char *buf, int len)
|
2005-10-26 02:18:38 -04:00
|
|
|
return(NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
- return strcpy(buf, b);
|
|
|
|
+ strlcpy(buf, b, len);
|
|
|
|
+ return buf;
|
|
|
|
}
|
|
|
|
#endif
|