summaryrefslogtreecommitdiff
path: root/main/adsi.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2012-06-26 13:23:12 +0000
committerMatthew Jordan <mjordan@digium.com>2012-06-26 13:23:12 +0000
commitee1111869585af74ea79a0bf45edcee49c00508b (patch)
tree118758247c128e65a4a64b7bbd16e089ef70c026 /main/adsi.c
parent5d31fb2dd258559d851b83f9eedb7f4e1452b071 (diff)
Fix crash in unloading of res_adsi module
When res_adsi is unloaded, it removes the ADSI functions that it previously installed by passing a NULL adsi_funcs pointer to ast_adsi_install_funcs. This function was not checking whether or not the adsi_funcs pointer passed in was NULL before dereferencing it to check whether or not the version of the functions matches what the core was expecting it. This patch makes it so that the version is only checked if a potentially valid adsi_funcs pointer was passed in. Passing in NULL removes the installed functions, bypassing the version check. ........ Merged revisions 369390 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369391 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/adsi.c')
-rw-r--r--main/adsi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/adsi.c b/main/adsi.c
index 870b13291..bb8570af3 100644
--- a/main/adsi.c
+++ b/main/adsi.c
@@ -339,7 +339,7 @@ int ast_adsi_input_format(unsigned char *buf, int num, int dir, int wrap, char *
void ast_adsi_install_funcs(const struct adsi_funcs *funcs)
{
- if (funcs->version < current_adsi_version) {
+ if (funcs && funcs->version < current_adsi_version) {
ast_log(LOG_WARNING, "Cannot install ADSI function pointers due to version mismatch."
"Ours: %u, Theirs: %u\n", current_adsi_version, funcs->version);
return;