NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/53831: libhfs might be wrong in edge cases



The following reply was made to PR kern/53831; it has been noted by GNATS.

From: coypu%sdf.org@localhost
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/53831: libhfs might be wrong in edge cases
Date: Thu, 3 Jan 2019 17:38:48 +0000

 Another one of this type that is worth inspecting is:
 
 hfslib_find_catalog_record_with_key
 ..
 
 
 
     597 	do {
 ...
     611 		for (recnum = 0; recnum < nd.num_recs; recnum++)
     612 		{
 ...
     648 			} else if (keycompare == 0) {
     649 				/* If leaf node, found an exact match. */
     650 				result = 0;
     651 				break;
 
 ..
     667 	} while (nd.kind != HFS_LEAFNODE);
 
 This is somewhat risky, because we are in one of two loops, break;
 is not for both of them.
 
 I am still not sure, just the code choices seemed fishy on a drive-by
 inspection of all src :-)
 


Home | Main Index | Thread Index | Old Index