-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Thank you for your file system tutorial, it has helped me a lot.
However, I think that the memcpy in the do_read function accesses memory which is out of bounds because size is 4096, but selectedText is much shorter.
Line 91 in 5bc24f8
| memcpy( buffer, selectedText + offset, size ); |
Surprisingly, valgrind does not complain about this, so maybe I am wrong?
Anyway, it is probably a good idea to also set the correct file size in do_getattr because some programs simply check the file size and then try to read and use that many bytes, ignoring that fread might have returned a much smaller number of bytes.
Metadata
Metadata
Assignees
Labels
No labels