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