diff options
author | jpeeler <jpeeler@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2008-02-15 23:33:44 +0000 |
---|---|---|
committer | jpeeler <jpeeler@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2008-02-15 23:33:44 +0000 |
commit | 890f4784c1483bbf9d4fbc83d9dd210b5b93d43e (patch) | |
tree | a6e737a6434cb08ac4cbb9cde4f38e0ea98d7c01 /ztdynamic.c | |
parent | c1cbe89ec4051c38ec600cc8b4cc0ed0deb10bb4 (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 'ztdynamic.c')
-rw-r--r-- | ztdynamic.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ztdynamic.c b/ztdynamic.c index e8623cc..8341af5 100644 --- a/ztdynamic.c +++ b/ztdynamic.c @@ -579,8 +579,8 @@ static int create_dynamic(ZT_DYNAMIC_SPAN *zds) memset(z->msgbuf, 0, bufsize); /* Setup parameters properly assuming we're going to be okay. */ - strncpy(z->dname, zds->driver, sizeof(z->dname) - 1); - strncpy(z->addr, zds->addr, sizeof(z->addr) - 1); + zap_copy_string(z->dname, zds->driver, sizeof(z->dname)); + zap_copy_string(z->addr, zds->addr, sizeof(z->addr)); z->timing = zds->timing; sprintf(z->span.name, "ZTD/%s/%s", zds->driver, zds->addr); sprintf(z->span.desc, "Dynamic '%s' span at '%s'", zds->driver, zds->addr); |