[Asterisk-code-review] core: Fix NPE in ast_manager_build_channel_state_string when snapshot... (asterisk[16])

Sean Bright asteriskteam at digium.com
Thu Apr 9 08:44:01 CDT 2020


Sean Bright has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/14144 )

Change subject: core: Fix NPE in ast_manager_build_channel_state_string when snapshot is NULL
......................................................................


Patch Set 1: Code-Review-1

(1 comment)

Adding this NULL check will stop the crash, but my question is: why are we passing NULL snapshots? Is that OK?

https://gerrit.asterisk.org/c/asterisk/+/14144/1/main/manager_channels.c 
File main/manager_channels.c:

https://gerrit.asterisk.org/c/asterisk/+/14144/1/main/manager_channels.c@496 
PS1, Line 496: if (!snapshot)
             : 	{
             : 		ast_log(AST_LOG_WARNING, "Call to ast_manager_build_channel_state_string_prefix with NULL snapshot!\n");
             : 		return NULL;
             : 	}
The opening brace should be on the same line as the 'if' statement.

Change the ast_log to an ast_debug.



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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I3393e4d521ab6c4551b5434d013a5941706c28de
Gerrit-Change-Number: 14144
Gerrit-PatchSet: 1
Gerrit-Owner: Robert Sutton <rsutton at noojee.com.au>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-Comment-Date: Thu, 09 Apr 2020 13:44:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200409/3e16be40/attachment.html>


More information about the asterisk-code-review mailing list