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

Corey Farrell asteriskteam at digium.com
Fri Oct 13 10:32:17 CDT 2017


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



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/95/6795/1

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: newchange
Gerrit-Change-Id: I5b110c609f6dfe91339f782a99a431bca5837363
Gerrit-Change-Number: 6795
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/04c570d3/attachment.html>


More information about the asterisk-code-review mailing list