fix memleak in function utf7toutf8_copy#5495
Merged
skef merged 1 commit intofontforge:masterfrom Jan 1, 2025
Merged
Conversation
iorsh
approved these changes
Nov 14, 2024
Contributor
Author
|
[AFFECTED AND/OR FIXED VERSION(S)] [PROBLEM TYPE] – must contain at least one: Vulnerability Type, Root Cause, or Impact: [DESCRIPTION] This issue was assigned CVE-2025-50951 |
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.
A memory leak issue exist in function utf7toutf8_copy
LeakSanitizer result:
==821283==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 140 byte(s) in 4 object(s) allocated from:
#0 0x7fee68a14302 in __interceptor_malloc ../../../../src/libsanitizer/lsan/lsan_interceptors.cpp:75
#1 0x7fee68629bc6 in utf7toutf8_copy /root/fuzz/fuzz_fontforge/fontforge/fontforge/sfd.c:378
Reproduction:
export CFLAGS="-g -O0 -fsanitize=leak" CXXFLAGS="-g -O0 -fsanitize=leak"
cmake ..
make && make install
/usr/local/bin/fontforge -lang=ff -c 'Open($1)' poc_file
poc_file: poc_file.zip