Bad logic introduced as part of the fsdriver changes could cause
getdents to terminate early in these libraries.
Issue reported by r0ller.
Change-Id: If450d5ea85e830584878d8a4ec0f00519355a353
* the "." entry, the second position is for the ".." entry, and the next
* position numbers each represent a file in the directory.
*/
- do {
+ for (;;) {
/* Determine which inode and name to use for this entry.
* We have no idea whether the host will give us "." and/or "..",
* so generate our own and skip those from the host.
if (r < 0)
return r;
- } while (r > 0);
+ if (r == 0)
+ break;
+ }
return fsdriver_dentry_finish(&fsdentry);
}
fsdriver_dentry_init(&fsdentry, data, bytes, buf, bufsize);
- do {
+ for (;;) {
/* Determine which inode and name to use for this entry. */
pos = (*posp)++;
IFTODT(child->i_stat.mode));
if (r < 0)
return r;
- } while (r > 0);
+ if (r == 0)
+ break;
+ }
return fsdriver_dentry_finish(&fsdentry);
}