From 4be53ade84f4d8e758a2417884b19b370aa5ecf6 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 23 Sep 2009 17:21:23 +0000 Subject: Initial commit of log.c Fixed character buffer overflow when copying the media names from the structure. --- netnuke.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'netnuke.c') diff --git a/netnuke.c b/netnuke.c index 3f75f47..4c2aa41 100644 --- a/netnuke.c +++ b/netnuke.c @@ -143,8 +143,8 @@ int nuke(media_t device) uint64_t size = device.size; char media[BUFSIZ]; char mediashort[BUFSIZ]; - strncpy(media, device.name, strlen(device.name)); - strncpy(mediashort, device.nameshort, strlen(device.nameshort)); + memcpy(media, device.name, strlen(device.name)+1); + memcpy(mediashort, device.nameshort, strlen(device.nameshort)); /* test with 100MBs worth of data */ if(udef_testmode == true) -- cgit