You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned in issue #1, the original implementation used Windows-specific calls to obtain the latest version of OCX from GitHub using the HTTPS protocol. This PR implements the same functionality using CURL, which can be compiled both for Linux and macOS.
Furthermore, in file ui/dialogs/settings_dialog.h the wxSpinCtrl type is used, but the spinctrl.h header file is never included. I've also fixed it.
These changes are sufficient to compile the project for macOS, didn't test it on Linux.
Thanks for this, appreciate the cross-platform fix and catching the missing spinctrl.h include too.
One thing to fix before this can merge, in write_callback:
size_t total = size * nmemb;
strlcat((char*)userdata, ptr, total);
The third argument to strlcat needs to be the size of the destination buffer (128, from buf[128] in OCXFetchRemoteVersion), not the size of the chunk coming in from curl. Right now it's telling strlcat "you've got total bytes of room" where total is just however much data curl handed over that call. If the response ever comes back bigger than 128 bytes in one go, this overflows the buffer. Also worth checking, ptr from curl isn't guaranteed to be null-terminated, so strlcat scanning it like a C-string could read past its bounds too.
Right now userdata is just the raw char* buf, so write_callback has no way to know its capacity, that's the actual root cause. Might be worth passing a small struct (pointer + capacity + bytes-written-so-far) as userdata instead, so the callback can enforce the limit properly.
Could you fix it so it respects the actual remaining space in buf?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As mentioned in issue #1, the original implementation used Windows-specific calls to obtain the latest version of OCX from GitHub using the HTTPS protocol. This PR implements the same functionality using CURL, which can be compiled both for Linux and macOS.
Furthermore, in file ui/dialogs/settings_dialog.h the
wxSpinCtrltype is used, but thespinctrl.hheader file is never included. I've also fixed it.These changes are sufficient to compile the project for macOS, didn't test it on Linux.