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

Fix for invalid bsdiff file being created in delta package #1087

Closed
wants to merge 1 commit into from
Closed

Fix for invalid bsdiff file being created in delta package #1087

wants to merge 1 commit into from

Conversation

Keboo
Copy link
Contributor

@Keboo Keboo commented Jul 4, 2017

When the bsdiff fails to create a file it leaves a blank .bsdiff file sitting in the delta package which will cause the updates to fail. This occurs because the BinaryPatchUtility assumes that it should always be able to read at least 32 bytes from the stream.

If you would also like a fix to the BinaryPathcUtility.Apply method to handle empty streams I am happy to create that as well, however I think this should be sufficient.

Will likely submit another PR after I track down why the creation of the delta packages is throwing a divide by zero exception on my pdb file.

Squirrel.Windows NuGet version: 1.7.6

…g in the delta package which will cause the updates to fail.
// file and just removing it.
File.WriteAllText(targetFile.FullName + ".diff", "1");
using (FileStream of = File.Create(targetFile.FullName + ".bsdiff"))
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Move bracket ⬆️

@anaisbetts
Copy link
Contributor

Merged with fixups in ffaf5f2, thanks!

@anaisbetts anaisbetts closed this Jul 10, 2017
@Keboo Keboo deleted the fixEmptyBinaryPatchCreated branch July 10, 2017 21:14
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

Successfully merging this pull request may close these issues.

2 participants