Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fopen with directories makes fseek throw #60

Open
mhenschel opened this issue Sep 10, 2014 · 2 comments
Open

fopen with directories makes fseek throw #60

mhenschel opened this issue Sep 10, 2014 · 2 comments

Comments

@mhenschel
Copy link

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:

  1. This is the directory structure
    /directory/file.txt
  2. 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.

@JoeDupuis
Copy link

Adobe doesn seem to maintains the project anymore has they state in their last commit :

"Sadly this project is no longer being actively maintained by Adobe, if you want to contribute to improving crossbridge you might want to help out on a more active fork like the one here: https://github.com/vpmedia/crossbridge/"

You could post a feature request on this repo which is still maintained by the community : https://github.com/crossbridge-community/crossbridge

but it might never be worked on if it is undefined in the C standard.

@JoeDupuis
Copy link

Oh I see you already posted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants