Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

Fixed PHP-1505: negative files.length when storing file with size > 2GB in GridFS #865

Closed

Conversation

derickr
Copy link
Contributor

@derickr derickr commented Feb 5, 2016

I've not created a test, as it would mean shifting > 2GB around. I've verified it locally.

@@ -742,7 +742,7 @@ PHP_METHOD(MongoGridFS, storeFile)
char *buf;
zval *chunk_id = NULL;

int chunk_size = size-pos >= global_chunk_size || fp == 0 ? global_chunk_size : size-pos;
long chunk_size = size-pos >= global_chunk_size || fp == 0 ? global_chunk_size : size-pos;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to use unsigned here? Or a more platform-independent type, such as uint64?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but it needs to be done throughout the file. The user also said it didn't quite work for him, so that's why I didn't want to merge it yet either.

@jmikola
Copy link
Member

jmikola commented Mar 15, 2016

Superseded by #866.

@jmikola jmikola closed this Mar 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants