mirror of
				https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
				synced 2025-11-04 05:53:26 +00:00 
			
		
		
		
	gbproxy: Fix segfault for VTY delete-gbproxy-link
Currently the code segfaults when the link shall be deleted by IMSI
when the IMSI has not been set yet.
This patch adds a NULL check to skip the entry before calling
gsm48_mi_to_string,
Adresses:
Program received signal SIGSEGV, Segmentation fault.
0xb693af77 in gsm48_mi_to_string (string=0xbfffe020 "", str_len=200,
mi=0x0, mi_len=0) at gsm48.c:360
    360         mi_type = mi[0] & GSM_MI_TYPE_MASK;
    str_len=200, mi=0x0, mi_len=0) at gsm48.c:360
    self=0x807c9a0 <delete_gb_link_by_id_cmd>, vty=0xb4303c70,
     argc=3, argv=0xbfffe1c0) at gb_proxy_vty.c:670
...
Sponsored-by: On-Waves ehf
			
			
This commit is contained in:
		
				
					committed by
					
						
						Holger Hans Peter Freyther
					
				
			
			
				
	
			
			
			
						parent
						
							c79beec8f6
						
					
				
				
					commit
					6a1d428f56
				
			@@ -666,6 +666,8 @@ DEFUN(delete_gb_link_by_id, delete_gb_link_by_id_cmd,
 | 
			
		||||
				continue;
 | 
			
		||||
			break;
 | 
			
		||||
		case MATCH_IMSI:
 | 
			
		||||
			if (!link_info->imsi)
 | 
			
		||||
				continue;
 | 
			
		||||
			mi_buf[0] = '\0';
 | 
			
		||||
			gsm48_mi_to_string(mi_buf, sizeof(mi_buf),
 | 
			
		||||
					   link_info->imsi,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user