fix endian issue on patch
This commit is contained in:
		
							parent
							
								
									e1926bddf9
								
							
						
					
					
						commit
						6bdb0de51a
					
				| @ -27,13 +27,14 @@ index 45885c3..a070201 100644 | ||||
|  		       unsigned char *buf __BLKID_ATTR((unused))) | ||||
|  { | ||||
|  	struct swap_id_block *sws; | ||||
| @@ -843,6 +843,11 @@ static int probe_swap1(struct blkid_probe *probe,
 | ||||
| @@ -843,6 +843,12 @@ static int probe_swap1(struct blkid_probe *probe,
 | ||||
|  	if (!sws) | ||||
|  		return 1; | ||||
|   | ||||
| +	/* check for wrong version or zeroed pagecount, for sanity */
 | ||||
| +	if (!memcmp(id->bim_magic, "SWAPSPACE2", id->bim_len) &&
 | ||||
| +			(sws->sws_version != 1 || sws->sws_lastpage == 0))
 | ||||
| +			(blkid_le32(sws->sws_version) != 1 ||
 | ||||
| +			 sws->sws_lastpage == 0))
 | ||||
| +		return 1;
 | ||||
| +
 | ||||
|  	/* arbitrary sanity check.. is there any garbage down there? */ | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user