[Yaffs] A corner case bug in handling renames

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Martin Fouts
Date:  
To: yaffs
Subject: [Yaffs] A corner case bug in handling renames
One of our developers is running regression tests against yaffs and
reports the following:

yaffs_RenameObject line 2460 yaffs_guts.c

The return value from yaffs_FindObjectByName(oldDir, oldName) is not
checked before being dereferenced. This causes a crash when renaming an
invalid file.

Example...
    mkdir a
    mv a/. c


He worked around it in our calling code by making sure that
yaffs_RenameObject is never getting indirectly called if the source
object doesn't exist.

But we're wondering if it's a bug that should be fixed in yaffs_guts.

Suggestions?