mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-10-29 05:40:23 -04:00 
			
		
		
		
	Fix crash in path subset elimination
As reported in http://kpaste.net/04f1f3f it is possible to call enumeration_is_subset with null pointers. Handle that case instead of crashing. (It is also possible that Tanuk's pending element_is_subset patch solves the issue, but this nevertheless gives some extra security.) Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
		
							parent
							
								
									85291b1954
								
							
						
					
					
						commit
						5bfcb5d8a0
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		|  | @ -2890,8 +2890,8 @@ static pa_bool_t options_have_option(pa_alsa_option *options, const char *alsa_n | ||||||
| static pa_bool_t enumeration_is_subset(pa_alsa_option *a_options, pa_alsa_option *b_options) { | static pa_bool_t enumeration_is_subset(pa_alsa_option *a_options, pa_alsa_option *b_options) { | ||||||
|     pa_alsa_option *oa, *ob; |     pa_alsa_option *oa, *ob; | ||||||
| 
 | 
 | ||||||
|     pa_assert(a_options); |     if (!a_options) return TRUE; | ||||||
|     pa_assert(b_options); |     if (!b_options) return FALSE; | ||||||
| 
 | 
 | ||||||
|     /* If there is an option A offers that B does not, then A is not a subset of B. */ |     /* If there is an option A offers that B does not, then A is not a subset of B. */ | ||||||
|     PA_LLIST_FOREACH(oa, a_options) { |     PA_LLIST_FOREACH(oa, a_options) { | ||||||
|  | @ -3005,6 +3005,8 @@ static pa_bool_t element_is_subset(pa_alsa_element *a, pa_alsa_element *b, snd_m | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if (a->enumeration_use != PA_ALSA_ENUMERATION_IGNORE) { |     if (a->enumeration_use != PA_ALSA_ENUMERATION_IGNORE) { | ||||||
|  |         if (b->enumeration_use == PA_ALSA_ENUMERATION_IGNORE) | ||||||
|  |             return FALSE; | ||||||
|         if (!enumeration_is_subset(a->options, b->options)) |         if (!enumeration_is_subset(a->options, b->options)) | ||||||
|             return FALSE; |             return FALSE; | ||||||
|     } |     } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 David Henningsson
						David Henningsson