[Asterisk-code-review] pbx.c: Crash in handle hint change due to uninitialized values (asterisk[11])
Kevin Harwell
asteriskteam at digium.com
Wed Aug 17 16:49:10 CDT 2016
Kevin Harwell has uploaded a new change for review.
https://gerrit.asterisk.org/3601
Change subject: pbx.c: Crash in handle_hint_change due to uninitialized values
......................................................................
pbx.c: Crash in handle_hint_change due to uninitialized values
handle_hint_change calls extension_presence_state_helper, which returns the
presence state subtype and message when a valid state is available. If the
state is invalid then those values are not filled. If they have not been
properly initialized to NULL then when ast_free is later called on them
Asterisk crashes.
This patch initializes the subtype and message to NULL.
ASTERISK-25706 #close
patches:
0008-handle_hint_change-initialize-presence_state.patch
submitted by Tzafrir Cohen (license 5035)
Change-Id: I2eb08c68951b327c42df0798de60484c3a225a50
---
M main/pbx.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/01/3601/1
diff --git a/main/pbx.c b/main/pbx.c
index 41094c5..d979839 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -6143,7 +6143,7 @@
struct ast_hint *hint = data;
struct ast_str *hint_app;
int state;
- struct presencechange presence_state;
+ struct presencechange presence_state = {};
if (!(hint_app = ast_str_create(1024))) {
return -1;
--
To view, visit https://gerrit.asterisk.org/3601
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2eb08c68951b327c42df0798de60484c3a225a50
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
More information about the asterisk-code-review
mailing list