Skip to content

fix memleak in function utf7toutf8_copy#5495

Merged
skef merged 1 commit intofontforge:masterfrom
xiaoxiaoafeifei:master
Jan 1, 2025
Merged

fix memleak in function utf7toutf8_copy#5495
skef merged 1 commit intofontforge:masterfrom
xiaoxiaoafeifei:master

Conversation

@xiaoxiaoafeifei
Copy link
Copy Markdown
Contributor

@xiaoxiaoafeifei xiaoxiaoafeifei commented Nov 13, 2024

  • Bug fix
    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

Copy link
Copy Markdown
Contributor

@skef skef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@skef skef merged commit dcb6efb into fontforge:master Jan 1, 2025
@xiaoxiaoafeifei
Copy link
Copy Markdown
Contributor Author

xiaoxiaoafeifei commented Aug 2, 2025

[AFFECTED AND/OR FIXED VERSION(S)]
AFFECTED VERSION: FontForge - version: <=20230101
FIXED VERSION: current master branch(#5495)

[PROBLEM TYPE] – must contain at least one: Vulnerability Type, Root Cause, or Impact:
Vulnerability Type: memory leak
Impact: Denial of Service

[DESCRIPTION]
FontForge <=20230101 is contains a memory leak in function DlgCreate8.

This issue was assigned CVE-2025-50951

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants