aboutsummaryrefslogtreecommitdiff
path: root/netnuke.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunk@stsci.edu>2009-09-23 13:21:23 -0400
committerJoseph Hunkeler <jhunk@stsci.edu>2009-09-23 13:21:23 -0400
commit4be53ade84f4d8e758a2417884b19b370aa5ecf6 (patch)
tree21ec7b268d3d63974191757d03386e97a853b24e /netnuke.c
parentb78b5de00ee3a127ed1dad01d18e96338ea0ab92 (diff)
downloadNetNuke-4be53ade84f4d8e758a2417884b19b370aa5ecf6.tar.gz
Initial commit of log.c
Fixed character buffer overflow when copying the media names from the structure.
Diffstat (limited to 'netnuke.c')
-rw-r--r--netnuke.c4
1 files changed, 2 insertions, 2 deletions
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)