diff options
author | Richard Mudgett <rmudgett@digium.com> | 2017-03-02 21:27:00 -0600 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2017-03-02 21:43:23 -0600 |
commit | 4271c700f747f40dd2f46f1f868cfb89d1cf78f8 (patch) | |
tree | 99168b3ce764adff124b5d06b5c62c4ae0336e14 /channels | |
parent | 75ebd8f0d2cdd146ab071391334ec7106ff29e94 (diff) |
core: Cleanup ast_get_hint() usage.
* manager.c:manager_state_cb() Fix potential use of uninitialized hint[]
if a hint does not exist for the requested extension. Ran into this when
developing a testsuite test. The AMI event ExtensionStatus came out with
the hint header value containing garbage. The AMI event PresenceStatus
also had the same issue.
* manager.c:action_extensionstate() no need to completely initialize the
hint[]. Only initialize the first element.
* pbx.c:ast_add_hint() Remove unnecessary assignment.
* chan_sip.c: Eliminate an unneeded hint[] local variable. We only care
about the return value of ast_get_hint() there.
Change-Id: Ia9a8786f01f93f1f917200f0a50bead0319af97b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 9a5d6c5e3..a0d414483 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -18306,10 +18306,11 @@ static enum sip_get_dest_result get_destination(struct sip_pvt *p, struct sip_re /* If this is a subscription we actually just need to see if a hint exists for the extension */ if (req->method == SIP_SUBSCRIBE) { - char hint[AST_MAX_EXTENSION]; int which = 0; - if (ast_get_hint(hint, sizeof(hint), NULL, 0, NULL, p->context, uri) || - (ast_get_hint(hint, sizeof(hint), NULL, 0, NULL, p->context, decoded_uri) && (which = 1))) { + + if (ast_get_hint(NULL, 0, NULL, 0, NULL, p->context, uri) + || (ast_get_hint(NULL, 0, NULL, 0, NULL, p->context, decoded_uri) + && (which = 1))) { if (!oreq) { ast_string_field_set(p, exten, which ? decoded_uri : uri); } |