bubblewrap: Fix leak of xasprintf-ed source path for --(ro)-bind-fd flag#762
Open
bbhtt wants to merge 1 commit into
Open
bubblewrap: Fix leak of xasprintf-ed source path for --(ro)-bind-fd flag#762bbhtt wants to merge 1 commit into
bbhtt wants to merge 1 commit into
Conversation
When --bind-fd or --ro-bind-fd is used, op->source is set to a
heap-allocated string from xasprintf() which was not being free-d
The trace is from 0.11.0
```
Direct leak of 34 byte(s) in 2 object(s) allocated from:
#0 0x7fb8df6fd9c7 (/lib/x86_64-linux-gnu/libasan.so.8+0xfd9c7) (BuildId: 0241d5a774aeb1d6babd9f68d743bdcf31b4a97d)
containers#1 0x7fb8dea8f947 (/lib/x86_64-linux-gnu/libc.so.6+0x8f947) (BuildId: 8e9fd827446c24067541ac5390e6f527fb5947bb)
containers#2 0x7fb8df6cf32e (/lib/x86_64-linux-gnu/libasan.so.8+0xcf32e) (BuildId: 0241d5a774aeb1d6babd9f68d743bdcf31b4a97d)
containers#3 0x55f2646fdddd in xasprintf ../subprojects/bubblewrap/utils.c:364
containers#4 0x55f2646e73e7 in parse_args_recurse ../subprojects/bubblewrap/bubblewrap.c:2018
containers#5 0x55f2646e5867 in parse_args_recurse ../subprojects/bubblewrap/bubblewrap.c:1855
containers#6 0x55f2646efc76 in parse_args ../subprojects/bubblewrap/bubblewrap.c:2782
containers#7 0x55f2646f10e8 in main ../subprojects/bubblewrap/bubblewrap.c:2927
containers#8 0x7fb8dea2a1c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 8e9fd827446c24067541ac5390e6f527fb5947bb)
containers#9 0x7fb8dea2a28a (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 8e9fd827446c24067541ac5390e6f527fb5947bb)
containers#10 0x55f2646d7344 in _start (/home/runner/work/flatpak/flatpak/builddir/subprojects/bubblewrap/flatpak-bwrap+0x3b344) (BuildId: c4d1276e28ed30dbeb13c58c7bd96078e062ef26)
SUMMARY: AddressSanitizer: 34 byte(s) leaked in 2 allocation(s).
```
Signed-off-by: bbhtt <bbhtt.zn0i8@slmail.me>
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.
When --bind-fd or --ro-bind-fd is used, op->source is set to a heap-allocated string from xasprintf() which was not being free-d
The trace is from 0.11.0