* fix check in PackageWriter against ".."

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40212 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe 2011-01-12 14:28:58 +00:00
parent ca7aa99f98
commit 170c1cc032

View File

@ -746,8 +746,8 @@ PackageWriter::_RegisterEntry(Entry* parent, const char* name,
size_t nameLength, bool isImplicit)
{
// check the component name -- don't allow "." or ".."
if (*name == '.'
&& (nameLength == 1 || (nameLength == 2 && name[2] == '.'))) {
if (name[0] == '.'
&& (nameLength == 1 || (nameLength == 2 && name[1] == '.'))) {
fprintf(stderr, "Error: Invalid file name: \".\" and \"..\" "
"are not allowed as path components\n");
throw status_t(B_BAD_VALUE);