Fix unsigned conversion bug.
Since readi() returns -1 for errors, checking with < against an unsigned value is inadvisable. Checking with != works as intended however.
This commit is contained in:
		
							parent
							
								
									462930727f
								
							
						
					
					
						commit
						e916d668f7
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		
							
								
								
									
										2
									
								
								exec.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								exec.c
									
										
									
									
									
								
							|  | @ -28,7 +28,7 @@ exec(char *path, char **argv) | |||
|   pgdir = 0; | ||||
| 
 | ||||
|   // Check ELF header
 | ||||
|   if(readi(ip, (char*)&elf, 0, sizeof(elf)) < sizeof(elf)) | ||||
|   if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf)) | ||||
|     goto bad; | ||||
|   if(elf.magic != ELF_MAGIC) | ||||
|     goto bad; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Peter H. Froehlich
						Peter H. Froehlich