LegacyPackageInstaller: Fix strnlen/strncmp usage.

I should have my "License to C" revoked...
This commit is contained in:
Augustin Cavalier 2017-01-05 16:48:44 -05:00
parent 5f050a9e7a
commit 02b11c1982
1 changed files with 2 additions and 2 deletions

View File

@ -361,8 +361,8 @@ UninstallView::_ReloadAppList()
if (iter.GetNodeRef(&ref) != B_OK)
continue;
if (strncmp(filename + (strnlen(filename, B_FILE_NAME_LENGTH) - 3),
"pdb", 3) != 0) {
size_t len = strnlen(filename, B_FILE_NAME_LENGTH);
if (len < 3 || strncmp(filename + (len - 3), "pdb", 3) != 0) {
printf("Ignoring non-package '%s'\n", filename);
continue;
}