diff options
author | Erwin Lansing <erwin@FreeBSD.org> | 2013-07-24 07:12:55 +0000 |
---|---|---|
committer | Erwin Lansing <erwin@FreeBSD.org> | 2013-07-24 07:12:55 +0000 |
commit | 6f34f6a389ca8199c4b20c17f62d7d924baef7fb (patch) | |
tree | e392027bf54f7a1fd2a6f3a16ecb4487844b44e9 /lib/isc/unix/entropy.c | |
parent | 650b026006ec14e630f658a0f877099ec38b660b (diff) |
Notes
Diffstat (limited to 'lib/isc/unix/entropy.c')
-rw-r--r-- | lib/isc/unix/entropy.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/isc/unix/entropy.c b/lib/isc/unix/entropy.c index ab53faf6754e..9c422b55a38b 100644 --- a/lib/isc/unix/entropy.c +++ b/lib/isc/unix/entropy.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008, 2012 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -536,8 +536,7 @@ isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname) { memset(&sname, 0, sizeof(sname)); sname.sun_family = AF_UNIX; - strncpy(sname.sun_path, fname, sizeof(sname.sun_path)); - sname.sun_path[sizeof(sname.sun_path)-1] = '0'; + strlcpy(sname.sun_path, fname, sizeof(sname.sun_path)); #ifdef ISC_PLATFORM_HAVESALEN #if !defined(SUN_LEN) #define SUN_LEN(su) \ |