Commit 69768018 authored by Mark Andrews's avatar Mark Andrews
Browse files

Replace memset() w/ null assignment to last element of array.

the strncpy() fills in the other bytes.
parent d119051e
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: mem.c,v 1.76 2000/12/29 01:02:07 bwelling Exp $ */
/* $Id: mem.c,v 1.77 2001/01/09 00:39:46 marka Exp $ */
#include <config.h>
......@@ -1379,8 +1379,8 @@ isc_mempool_setname(isc_mempool_t *mpctx, const char *name) {
if (mpctx->lock != NULL)
LOCK(mpctx->lock);
memset(mpctx->name, 0, sizeof(mpctx->name));
strncpy(mpctx->name, name, sizeof(mpctx->name) - 1);
mpctx->name[sizeof(mpctx->name) - 1] = '\0';
if (mpctx->lock != NULL)
UNLOCK(mpctx->lock);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment