[Asterisk-code-review] bridge.c: Fixed null pointer exception (asterisk[master])

sungtae kim asteriskteam at digium.com
Thu May 28 20:07:18 CDT 2020


sungtae kim has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/14448 )


Change subject: bridge.c: Fixed null pointer exception
......................................................................

bridge.c: Fixed null pointer exception

If the bridge show all command could not get the bridge snapshot, it causes null pointer exception.
Fixed it to check the snapshot is null.

ASTERISK-28920

Change-Id: I3521fc1b832bfc69644d0833f2c78177e1e51f58
---
M main/bridge.c
1 file changed, 1 insertion(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/48/14448/1

diff --git a/main/bridge.c b/main/bridge.c
index c13cda2..fb7012d 100644
--- a/main/bridge.c
+++ b/main/bridge.c
@@ -5086,9 +5086,8 @@
 		struct ast_bridge_snapshot *snapshot = ast_bridge_get_snapshot(bridge);
 		char print_time[32];
 
-		ast_format_duration_hh_mm_ss(ast_tvnow().tv_sec - snapshot->creationtime.tv_sec, print_time, sizeof(print_time));
-
 		if (snapshot) {
+			ast_format_duration_hh_mm_ss(ast_tvnow().tv_sec - snapshot->creationtime.tv_sec, print_time, sizeof(print_time));
 			ast_cli(a->fd, FORMAT_ROW,
 				snapshot->uniqueid,
 				snapshot->num_channels,

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14448
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I3521fc1b832bfc69644d0833f2c78177e1e51f58
Gerrit-Change-Number: 14448
Gerrit-PatchSet: 1
Gerrit-Owner: sungtae kim <pchero21 at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200528/5db64426/attachment.html>


More information about the asterisk-code-review mailing list