vmdk: Fix vmdk_parse_extents
An extra 'p++' after while loop when *p == '\n' will move p to unknown data position, risking parsing junk data or memory access violation. Cc: qemu-stable@nongnu.org Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
		
							parent
							
								
									b681072d20
								
							
						
					
					
						commit
						899f1ae219
					
				@ -772,11 +772,14 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
 | 
			
		||||
        }
 | 
			
		||||
next_line:
 | 
			
		||||
        /* move to next line */
 | 
			
		||||
        while (*p && *p != '\n') {
 | 
			
		||||
        while (*p) {
 | 
			
		||||
            if (*p == '\n') {
 | 
			
		||||
                p++;
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
            p++;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user