Summary:ASTERISK-19718: ast_app_inboxcount2() calls ast_inboxcount2_func without checking if it's assigned (instead checks ast_inboxcount_func)
Reporter:Corey Farrell (coreyfarrell)Labels:
Date Opened:2012-04-12 19:00:19Date Closed:2012-05-01 13:26:19
Versions:SVN Frequency of
Environment:Attachments:( 0) ast_app_inboxcount2-null-refcheck.patch
Description:in main/app.c, ast_app_inboxcount2():
if (ast_inboxcount_func) {
return ast_inboxcount2_func(mailbox, urgentmsgs, newmsgs, oldmsgs);

I marked this as trivial since ast_inboxcount_func and ast_inboxcount2_func are set together, but still feel this is worth fixing.
Comments:By: Corey Farrell (coreyfarrell) 2012-04-12 19:01:25.177-0500

patch to check the correct function pointer variable

By: Jonathan Rose (jrose) 2012-05-01 13:09:35.511-0500

Oh yeah, definitely no reason not to do this.  I mean, presumably someone could make a replacement for app_voicemail that registers voicemail functions completely differently (leaving ast_inboxcount as NULL while having an ast_inboxcount2 for whatever reason), and this could cause a little havoc in that case.