fat: Fix stack corruption on 64 bit due to wrong count type.

On 64 bit platforms a 64 bit size_t was written at the (incorrect)
uint32 on the stack, causing the adjacent bytes variable to be
clobbered. Because of this, the vectors wouldn't actually be filled
with any file data, making the content of files inacessible.
This commit is contained in:
Michael Lotz 2015-05-02 11:58:31 +02:00
parent 110eea4517
commit 09592b1dcc

View File

@ -1439,7 +1439,7 @@ dosfs_read_pages(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
while (true) {
struct file_io_vec fileVecs[8];
uint32 fileVecCount = 8;
size_t fileVecCount = 8;
bool bufferOverflow;
size_t bytes = bytesLeft;
@ -1483,7 +1483,7 @@ dosfs_write_pages(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
while (true) {
struct file_io_vec fileVecs[8];
uint32 fileVecCount = 8;
size_t fileVecCount = 8;
bool bufferOverflow;
size_t bytes = bytesLeft;