]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Use ast_copy_string() instead of strncpy(), and use sizeof() instead of
authorRussell Bryant <russell@russellbryant.com>
Tue, 4 Mar 2008 04:26:39 +0000 (04:26 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 4 Mar 2008 04:26:39 +0000 (04:26 +0000)
a magic number

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105589 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/pbx.c

index 3c42a623367383ddd64ea26dbf85a417b14f09eb..ff39a8c6652320794bb36028dd3ea5aef58d6ff9 100644 (file)
@@ -3623,8 +3623,11 @@ static struct ast_context *find_context_locked(const char *context)
 {
        struct ast_context *c = NULL;
        struct fake_context item;
-       strncpy(item.name, context, 256);
+
+       ast_copy_string(item.name, context, sizeof(item.name));
+
        ast_rdlock_contexts();
+
        c = ast_hashtab_lookup(contexts_tree,&item);
 
 #ifdef NOTNOW