Conversation
db026fb to
eee7c7c
Compare
Member
Author
|
New versions of LZMA are distributed as 7z archives here: If someones wants to investigate the C++ library, it can be found in the |
5ee90e3 to
7956a47
Compare
7956a47 to
1acda32
Compare
crnlib/lzma/Ppmd7Enc.c: R->Low += start * R->Range; Multiplication result may overflow 'unsigned int' before it is converted to 'unsigned long'.
crnlib/lzma/Bcj2Enc.c: In function ‘Bcj2Enc_Encode’:
crnlib/lzma/Bcj2Enc.c:488:20: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
488 | p->temp[i] = src[i];
| ~~~~~~~~~~~^~~~~~~~
In file included from crnlib/lzma/Bcj2Enc.c:14:
crnlib/lzma/Bcj2.h:287:8: note: at offset 8 into destination object ‘temp’ of size 8
287 | Byte temp[8];
| ^
1acda32 to
6a6b5a7
Compare
slipher
reviewed
Mar 19, 2025
| do | ||
| p->temp[i] = src[i]; | ||
| while (++i != rem); | ||
| while (++i != rem + 1); |
Member
There was a problem hiding this comment.
This doesn't any make any sense. How would you fix a buffer overflow by making it copy MORE data?
I suggest not making any local edits to 3rd-party libraries unless it is truly necessary.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
That's an old branch sitting on my computer, updating the very old LZMA shipped with crunch with the last one from upstream.
What annoys me is that Crunch is a C++ library but it shipped with the C LZMA library, adding custom wrapping code to make it compilable with a C++ compiler. I don't want to have to replay such change on every LZMA update, so I included it as a C library, meaning I had to make Crunch not only a C++ project but a C++ & C project, meaning selecting a different compiler requires to select both the C++ and C compiler…
An alternative would be to move to the C++ LZMA library but then that requires to port the code to the C++ LZMA API I guess… and I'm lazy. All I want is to make sure we use latest versions of libraries and don't sit on very old dependencies with potential unfixed decades-old issues.