diff options
author | Russell Bryant <russell@russellbryant.com> | 2008-03-04 04:26:39 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2008-03-04 04:26:39 +0000 |
commit | 71173779dca6f759112e0bb5b430a99ce198cf19 (patch) | |
tree | 94911ab654fd3ae285bfb1dbee2cee96b0f49ec0 /main | |
parent | 0db8a98efeef484430b7b47d2c7dffd998ea7e14 (diff) |
Use ast_copy_string() instead of strncpy(), and use sizeof() instead of
a magic number
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r-- | main/pbx.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/main/pbx.c b/main/pbx.c index 3c42a6233..ff39a8c66 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -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 |