summaryrefslogtreecommitdiff
path: root/tor2ee.c
diff options
context:
space:
mode:
authorjpeeler <jpeeler@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-02-15 23:33:44 +0000
committerjpeeler <jpeeler@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-02-15 23:33:44 +0000
commit890f4784c1483bbf9d4fbc83d9dd210b5b93d43e (patch)
treea6e737a6434cb08ac4cbb9cde4f38e0ea98d7c01 /tor2ee.c
parentc1cbe89ec4051c38ec600cc8b4cc0ed0deb10bb4 (diff)
Fixes bug 11471. Replaced all instances of strncpy with zap_copy_string (added to zaptel.h) to fix any off by one errors and ensure destination string is NULL terminated.
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@3833 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'tor2ee.c')
-rw-r--r--tor2ee.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tor2ee.c b/tor2ee.c
index dc671cb..575e0ef 100644
--- a/tor2ee.c
+++ b/tor2ee.c
@@ -779,7 +779,7 @@ static int write_eeprom_file(char *filename, char *revision, struct pci_eeprom *
/* Store revision number */
memset(ee->revision, 0, sizeof(ee->revision));
- strncpy(ee->revision, revision, sizeof(ee->revision));
+ zap_copy_string(ee->revision, revision, sizeof(ee->revision));
/* Calculate FCS on revision and data */
ee->crc16 = htons(calc_crc16((char *)ee, sizeof(*ee) - 2));
@@ -1051,7 +1051,7 @@ int main(int argc, char *argv[])
exit(1);
}
modify(&ee, reg, val);
- strncpy(tmp, ee.revision, sizeof(tmp));
+ zap_copy_string(tmp, ee.revision, sizeof(tmp));
if (write_eeprom_file(writefile, tmp, &ee)) {
fprintf(stderr, "Unable to write EEPROM file\n");
closemem();