mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 08:44:41 +00:00 
			
		
		
		
	parisc: Fix read buffer overflow in pdc_stable driver
Check whether index is within bounds before testing the element. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
		
							parent
							
								
									b4f2e2ad53
								
							
						
					
					
						commit
						447c233da4
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -370,7 +370,7 @@ pdcspath_layer_read(struct pdcspath_entry *entry, char *buf) | |||
| 	if (!i)	/* entry is not ready */ | ||||
| 		return -ENODATA; | ||||
| 	 | ||||
| 	for (i = 0; devpath->layers[i] && (likely(i < 6)); i++) | ||||
| 	for (i = 0; i < 6 && devpath->layers[i]; i++) | ||||
| 		out += sprintf(out, "%u ", devpath->layers[i]); | ||||
| 
 | ||||
| 	out += sprintf(out, "\n"); | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Roel Kluin
						Roel Kluin