mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-29 15:36:13 +00:00 
			
		
		
		
	res_stasis_snoop: Fix snoop crash
Added NULL pointer check and channel lock to prevent resource release while the chanspy is processing. ASTERISK-29604 Change-Id: Ibdc675f98052da32333b19685b1708a3751b6d24
This commit is contained in:
		
				
					committed by
					
						 Friendly Automation
						Friendly Automation
					
				
			
			
				
	
			
			
			
						parent
						
							c448dcd2f0
						
					
				
				
					commit
					1da489a434
				
			| @@ -135,9 +135,13 @@ static void publish_chanspy_message(struct stasis_app_snoop *snoop, int start) | ||||
| 	} | ||||
| 	ast_multi_channel_blob_add_channel(payload, "spyer_channel", snoop_snapshot); | ||||
|  | ||||
| 	spyee_snapshot = ast_channel_snapshot_get_latest(ast_channel_uniqueid(snoop->spyee_chan)); | ||||
| 	if (spyee_snapshot) { | ||||
| 		ast_multi_channel_blob_add_channel(payload, "spyee_channel", spyee_snapshot); | ||||
| 	if (snoop->spyee_chan) { | ||||
| 		ast_channel_lock(snoop->spyee_chan); | ||||
| 		spyee_snapshot = ast_channel_snapshot_get_latest(ast_channel_uniqueid(snoop->spyee_chan)); | ||||
| 		ast_channel_unlock(snoop->spyee_chan); | ||||
| 		if (spyee_snapshot) { | ||||
| 			ast_multi_channel_blob_add_channel(payload, "spyee_channel", spyee_snapshot); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	message = stasis_message_create(type, payload); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user