diff options
Diffstat (limited to 'res/res_crypto.c')
-rwxr-xr-x | res/res_crypto.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/res/res_crypto.c b/res/res_crypto.c index 43936a297..796515ee3 100755 --- a/res/res_crypto.c +++ b/res/res_crypto.c @@ -217,9 +217,9 @@ static struct ast_key *try_load_key (char *dir, char *fname, int ifd, int ofd, i if (found) ast_mutex_lock(&keylock); /* First the filename */ - strncpy(key->fn, ffname, sizeof(key->fn) - 1); + ast_copy_string(key->fn, ffname, sizeof(key->fn)); /* Then the name */ - strncpy(key->name, fname, sizeof(key->name) - 1); + ast_copy_string(key->name, fname, sizeof(key->name)); key->ktype = ktype; /* Yes, assume we're going to be deleted */ key->delme = 1; @@ -529,7 +529,7 @@ static int init_keys(int fd, int argc, char *argv[]) /* Reload keys that need pass codes now */ if (key->ktype & KEY_NEEDS_PASSCODE) { kn = key->fn + strlen(ast_config_AST_KEY_DIR) + 1; - strncpy(tmp, kn, sizeof(tmp) - 1); + ast_copy_string(tmp, kn, sizeof(tmp)); try_load_key((char *)ast_config_AST_KEY_DIR, tmp, fd, fd, &ign); } key = key->next; |