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

Corey Farrell asteriskteam at digium.com
Fri Oct 13 10:33:04 CDT 2017


Corey Farrell has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/97/6797/1

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: newchange
Gerrit-Change-Id: I5b110c609f6dfe91339f782a99a431bca5837363
Gerrit-Change-Number: 6797
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171013/12719521/attachment.html>


More information about the asterisk-code-review mailing list