diff options
author | Nathan Binkert <binkertn@umich.edu> | 2005-08-23 11:38:27 -0400 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2005-08-23 11:38:27 -0400 |
commit | 1771ee203fd749b21a51439cde853f7134688f30 (patch) | |
tree | 830f4e123bdc1a6538cbe307085b29fca55046ef /dev | |
parent | 03e256b0f004bfe1dbe4006878b4479f25484b74 (diff) | |
download | gem5-1771ee203fd749b21a51439cde853f7134688f30.tar.xz |
don't use sprintf. It's not guaranteed to not scribble over memory.
base/remote_gdb.cc:
use snprintf, it's safer
dev/ide_disk.cc:
use strncpy instead of snprintf
--HG--
extra : convert_revision : 90455e3f6bcb4c771724298a5a0b79a5b483a85c
Diffstat (limited to 'dev')
-rw-r--r-- | dev/ide_disk.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/dev/ide_disk.cc b/dev/ide_disk.cc index bd9aac8ea..f178e44ed 100644 --- a/dev/ide_disk.cc +++ b/dev/ide_disk.cc @@ -92,7 +92,8 @@ IdeDisk::IdeDisk(const string &name, DiskImage *img, PhysicalMemory *phys, } // Setup the model name - sprintf((char *)driveID.atap_model, "5MI EDD si k"); + strncpy((char *)driveID.atap_model, "5MI EDD si k", + sizeof(driveID.atap_model)); // Set the maximum multisector transfer size driveID.atap_multi = MAX_MULTSECT; // IORDY supported, IORDY disabled, LBA enabled, DMA enabled |