vmg / sundown

Standards compliant, fast, secure markdown processing library in C
1.99k stars 385 forks source link

UBSan: src/buffer.c:162: runtime error: null pointer passed as argument 2, which is declared to never be null #159

Closed geeknik closed 6 years ago

geeknik commented 6 years ago

echo ">" | UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./sundown

src/buffer.c:162:32: runtime error: null pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:47:28: note: nonnull attribute specified here
    #0 0x521005 in bufput /root/sundown/src/buffer.c:162:2
    #1 0x52b79a in rndr_blockquote /root/sundown/html/html.c:159:12
    #2 0x4f8bbf in parse_blockquote /root/sundown/src/markdown.c:1423:3
    #3 0x4f8bbf in parse_block /root/sundown/src/markdown.c:2231
    #4 0x4f2bd5 in sd_markdown_render /root/sundown/src/markdown.c:2517:3
    #5 0x4ebedc in main /root/sundown/examples/sundown.c:67:2
    #6 0x7feb36e31b44 in __libc_start_main /build/glibc-6V9RKT/glibc-2.19/csu/libc-start.c:287
    #7 0x41c93b in _start (/root/sundown/tmp/out/crashes/sundown+0x41c93b)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/buffer.c:162:32