-
Notifications
You must be signed in to change notification settings - Fork 201
Open
Description
I created an embedded in memory backing store containing a directory with some files in it. In my C++ code I accidentally tried to fopen the directory instead of a file. The fopen works but when I try to seek to the end of the opened file (to get the file size by calling ftell) there is a null reference exception in
"PlayerKernel.lseekImpl"
For example:
- This is the directory structure
/directory/file.txt - This is the code that leads to the bug
FILE* file=fopen("directory");
if (file) {
fseek(File, 0, SEEK_END);
}
I think opening a directory might be undefined behavior in C++ but throwing exceptions into native C code in an fseek call is a problem. IMHO a reasonable thing to do would be to let the fopen call just fail for directories.
Metadata
Metadata
Assignees
Labels
No labels