Repository navigation
fix(common: xutil: xutil_get_text_property_from_reply): guard memcpy from receiving non-positive length - #4136
Open
actionless wants to merge 5 commits into
Open
actionless wants to merge 5 commits into
actionless wants to merge 5 commits into
Conversation
…from receiving negative length
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4136 +/- ##
==========================================
- Coverage 90.43% 90.43% -0.01%
==========================================
Files 941 941
Lines 60363 60364 +1
Branches 1139 1140 +1
==========================================
Hits 54591 54591
Misses 5266 5266
- Partials 506 507 +1
🚀 New features to boost your workflow:
|
…memcpy from receiving negative length fix(common: xutil: xutil_get_text_property_from_reply): simplify the code
actionless
force-pushed
the
fix-common-xutil-negative-len
branch
from
November 1, 2026 13:52
959f58b to
40dffad
Compare
… guard memcpy from receiving negative length fix(common: xutil: xutil_get_text_property_from_reply): simplify the code
…h to size_t to avoid potential INT_MAX overflow during `length + 1`
Member
|
I think it's a duplicate of #4087. I don't get this warning when building Awesome, and the latest CI run on master also don't report it (https://github.com/awesomeWM/awesome/actions/runs/40995784216/job/123868463047). I guess this is due to using another C compiler. @cnjhb mentioned they use clang. I haven't had the time to complete my work yet, but I think we should have a way to build Awesome with clang in our CI, and/or run clang-tidy to lint the C code. This would automatically detect and force us to resolve all these issues. |
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.
currently the build throws a warning:
because since xcb_get_property_value_length() returns a signed int, it makes the range of return value which later passed to memcpy() as length potentially negative
and above would cause to overflow the length into aforementioned length in the warning message