mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	topology: data: Fix wrong size check in tplg_parse_data_hex()
A wrong, uninitialized variable is referred as the size to check in
tplg_parse_data_hex().  Spotted by gcc warning:
  data.c: In function ‘tplg_parse_data_hex’:
  data.c:228:5: warning: ‘esize’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    if (esize > TPLG_MAX_PRIV_SIZE) {
        ^
  data.c:211:12: note: ‘esize’ was declared here
    int size, esize, off, num;
              ^
Signed-off-by: Takashi Iwai <tiwai@suse.de>
			
			
This commit is contained in:
		
							parent
							
								
									f41fe763e9
								
							
						
					
					
						commit
						5b21400c42
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -225,8 +225,8 @@ static int tplg_parse_data_hex(snd_config_t *cfg, struct tplg_elem *elem,
 | 
				
			||||||
	size = num * width;
 | 
						size = num * width;
 | 
				
			||||||
	priv = elem->data;
 | 
						priv = elem->data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (esize > TPLG_MAX_PRIV_SIZE) {
 | 
						if (size > TPLG_MAX_PRIV_SIZE) {
 | 
				
			||||||
		SNDERR("error: data too big %d\n", esize);
 | 
							SNDERR("error: data too big %d\n", size);
 | 
				
			||||||
		return -EINVAL;
 | 
							return -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue