[asterisk-commits] ast bt get symbols: Prevent double-free. (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Oct 15 14:20:38 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6795 )

Change subject: ast_bt_get_symbols: Prevent double-free.
......................................................................

ast_bt_get_symbols: Prevent double-free.

It's possible for bfdobj to be created but syms not created.  If syms
was not allocated in the current loop iteration but was allocated in the
previous iteration it would crash.

ASTERISK-27340

Change-Id: I5b110c609f6dfe91339f782a99a431bca5837363
---
M main/backtrace.c
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Richard Mudgett: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/main/backtrace.c b/main/backtrace.c
index a115646..1659890 100644
--- a/main/backtrace.c
+++ b/main/backtrace.c
@@ -173,6 +173,7 @@
 		if (bfdobj) {
 			bfd_close(bfdobj);
 			ast_std_free(syms);
+			syms = NULL;
 		}
 
 		/* Default output, if we cannot find the information within BFD */

-- 
To view, visit https://gerrit.asterisk.org/6795
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I5b110c609f6dfe91339f782a99a431bca5837363
Gerrit-Change-Number: 6795
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20171015/e95cca68/attachment.html>


More information about the asterisk-commits mailing list