Unsafe use of strncpy replaced by strlcpy. CID 2257.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40628 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2271,7 +2271,7 @@ tn(int argc, char *argv[])
|
|||||||
hostname = hostp;
|
hostname = hostp;
|
||||||
memset(&su, 0, sizeof su);
|
memset(&su, 0, sizeof su);
|
||||||
su.sun_family = AF_UNIX;
|
su.sun_family = AF_UNIX;
|
||||||
strncpy(su.sun_path, hostp, sizeof su.sun_path);
|
strlcpy(su.sun_path, hostp, sizeof su.sun_path);
|
||||||
printf("Trying %s...\n", hostp);
|
printf("Trying %s...\n", hostp);
|
||||||
net = socket(AF_UNIX, SOCK_STREAM, 0);
|
net = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||||
if ( net < 0) {
|
if ( net < 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user