mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	raop: Fix potential NULL dereference
wath may be NULL, as suggested by Hajime Fujita Coverity ID: #1398156 setting val = NULL is not needed Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Cc: Hajime Fujita <crisp.fujita@nifty.com>
This commit is contained in:
		
							parent
							
								
									a8ce3ef844
								
							
						
					
					
						commit
						4cfd544f21
					
				
					 1 changed files with 11 additions and 12 deletions
				
			
		| 
						 | 
				
			
			@ -1229,7 +1229,7 @@ static void rtsp_auth_cb(pa_rtsp_client *rtsp, pa_rtsp_state_t state, pa_rtsp_st
 | 
			
		|||
            const char *current = NULL;
 | 
			
		||||
            char space[] = " ";
 | 
			
		||||
            char *token, *ath = NULL;
 | 
			
		||||
            char *publ, *wath, *mth, *val;
 | 
			
		||||
            char *publ, *wath, *mth = NULL, *val;
 | 
			
		||||
            char *realm = NULL, *nonce = NULL, *response = NULL;
 | 
			
		||||
            char comma[] = ",";
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1244,19 +1244,18 @@ static void rtsp_auth_cb(pa_rtsp_client *rtsp, pa_rtsp_state_t state, pa_rtsp_st
 | 
			
		|||
                    goto fail;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                if (wath)
 | 
			
		||||
                if (wath) {
 | 
			
		||||
                    mth = pa_split(wath, space, ¤t);
 | 
			
		||||
                while ((token = pa_split(wath, comma, ¤t))) {
 | 
			
		||||
                    val = NULL;
 | 
			
		||||
                    if ((val = strstr(token, "="))) {
 | 
			
		||||
                        if (NULL == realm && val > strstr(token, "realm"))
 | 
			
		||||
                            realm = pa_xstrdup(val + 2);
 | 
			
		||||
                        else if (NULL == nonce && val > strstr(token, "nonce"))
 | 
			
		||||
                            nonce = pa_xstrdup(val + 2);
 | 
			
		||||
                        val = NULL;
 | 
			
		||||
                    }
 | 
			
		||||
                    while ((token = pa_split(wath, comma, ¤t))) {
 | 
			
		||||
                        if ((val = strstr(token, "="))) {
 | 
			
		||||
                            if (NULL == realm && val > strstr(token, "realm"))
 | 
			
		||||
                                realm = pa_xstrdup(val + 2);
 | 
			
		||||
                            else if (NULL == nonce && val > strstr(token, "nonce"))
 | 
			
		||||
                                nonce = pa_xstrdup(val + 2);
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                    pa_xfree(token);
 | 
			
		||||
                        pa_xfree(token);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                if (pa_safe_streq(mth, "Basic") && realm) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue