mirror of
				https://github.com/open5gs/open5gs.git
				synced 2025-11-03 21:43:25 +00:00 
			
		
		
		
	[AMF] Ignore unexpected PATCH method in gmm_state_authentication (#4074)
When the AMF receives a PATCH request for the registration API while in the gmm_state_authentication state, it currently crashes because the HTTP method is not handled. This appears to be a race condition. To fix this, explicitly handle OGS_SBI_HTTP_METHOD_PATCH by ignoring the message and logging an error, similar to the handling of other unexpected SBI messages.
This commit is contained in:
		@@ -2059,6 +2059,14 @@ void gmm_state_authentication(ogs_fsm_t *s, amf_event_t *e)
 | 
			
		||||
                     */
 | 
			
		||||
                    ogs_error("[%s] Ignore SBI message", amf_ue->supi);
 | 
			
		||||
                    break;
 | 
			
		||||
                CASE(OGS_SBI_HTTP_METHOD_PATCH)
 | 
			
		||||
                    /*
 | 
			
		||||
                     * Issue #4074
 | 
			
		||||
                     *
 | 
			
		||||
                     * We need to ignore this message in this state.
 | 
			
		||||
                     */
 | 
			
		||||
                    ogs_error("[%s] Ignore SBI message", amf_ue->supi);
 | 
			
		||||
                    break;
 | 
			
		||||
                DEFAULT
 | 
			
		||||
                    ogs_error("[%s] Invalid HTTP method [%s]",
 | 
			
		||||
                            amf_ue->suci, sbi_message->h.method);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user