Skip to content

Fix "buffer is too large"#89

Closed
bandrews-spirent wants to merge 1 commit intosalesforce:masterfrom
bandrews-spirent:fixes
Closed

Fix "buffer is too large"#89
bandrews-spirent wants to merge 1 commit intosalesforce:masterfrom
bandrews-spirent:fixes

Conversation

@bandrews-spirent
Copy link

Increase to uint64

Increase to uint64
@salesforce-cla
Copy link

salesforce-cla bot commented Apr 8, 2025

Thanks for the contribution! Before we can merge this, we need @bandrews-spirent to sign the Salesforce Inc. Contributor License Agreement.

@twarit-waikar
Copy link
Contributor

I don't know enough about the libgit2 internals but probably this header needs to be changed as well?
https://github.com/salesforce/p4-fusion/blob/master/vendor/libgit2/include/git2/index.h#L62

But before that, could you give an example where this change is required?

@bandrews-spirent
Copy link
Author

To be complete, probably.
If you have large files in P4 greater than uint32 size, you will see the issue. With this change, I was able to create the git repo when the source P4 repo had large binary files.

@bandrews-spirent
Copy link
Author

Actually, I don't know why the limitation is there. The len parameter being passed in is already size_t. It's almost like the check is deliberate. (or was it naive)
I was able to use my change w/out any problems, but I can't guarantee it's not going to break other cases, because I don't understand the buffer check. Closing the PR.

@twaritwaikar
Copy link

twaritwaikar commented Apr 11, 2025

It might make sense to have this documented in the README/FAQ if someone encounters this problem and might want to invest in a potentially dangerous solution. Maybe the Git CLI would bug out if it found a file larger than UINT32T_MAX?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants