Skip to content

Use of uninitialized value in the md_push_block_bytes() function #130

Closed
@fcambus

Description

@fcambus

Hi,

While fuzzing md4c 0.4.5 with Honggfuzz, I found out that the md_push_block_bytes() function may use uninitialized memory.

Attaching a reproducer (gzipped so GitHub accepts it): test01.md.gz

Issue can be reproduced by running:

md2html test01.md
==257142==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7f6d02f3e5ed in md_push_block_bytes /home/fcambus/md4c-release-0.4.5/src/md4c.c:4848:12
    #1 0x7f6d02f3e5ed in md_start_new_block /home/fcambus/md4c-release-0.4.5/src/md4c.c:4868:25
    #2 0x7f6d02f3e5ed in md_process_line /home/fcambus/md4c-release-0.4.5/src/md4c.c:6147:9
    #3 0x7f6d02f3e5ed in md_process_doc /home/fcambus/md4c-release-0.4.5/src/md4c.c:6218:9
    #4 0x7f6d02f337e5 in md_parse /home/fcambus/md4c-release-0.4.5/src/md4c.c:6295:11
    #5 0x7f6d02f6f5c2 in md_html /home/fcambus/md4c-release-0.4.5/src/md4c-html.c:571:12
    #6 0x4964a9 in process_file /home/fcambus/md4c-release-0.4.5/md2html/md2html.c:144:11
    #7 0x4964a9 in main /home/fcambus/md4c-release-0.4.5/md2html/md2html.c:368:11
    #8 0x7f6d02bac0b2 in __libc_start_main /build/glibc-ZN95T4/glibc-2.31/csu/../csu/libc-start.c:308:16
    #9 0x41c29d in _start (/home/fcambus/md4c-release-0.4.5/md2html/md2html+0x41c29d)

SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/fcambus/md4c-release-0.4.5/src/md4c.c:4848:12 in md_push_block_bytes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions