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

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


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

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 0b29385..aed4ffd 100644
--- a/main/backtrace.c
+++ b/main/backtrace.c
@@ -172,6 +172,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/6797
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I5b110c609f6dfe91339f782a99a431bca5837363
Gerrit-Change-Number: 6797
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/5ee072a5/attachment.html>


More information about the asterisk-commits mailing list