New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tables with more columns than header segfault server #2132

Closed
WebFreak001 opened this Issue Mar 23, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@WebFreak001
Contributor

WebFreak001 commented Mar 23, 2018

| header | header |
|--------|--------|
|   a    | b  | c |

filterMarkdown with table setting (as seen in dub registry) will crash the server.

Stacktrace:

0x00005555558f26fc in _D4vibe10textfilter8markdown__T10writeBlockTS3std5array__T8AppenderTAyaZQoZQBsFKQBkKxSQDgQDeQCv5BlockHQBiSQEaQDyQDp7LinkRefMCQEtQErQEi16MarkdownSettingsZv (settings=0x7fffffffdc20, links=..., block=..., dst=...)
    at /home/webfreak/.dub/packages/vibe-d-0.8.3/vibe-d/textfilter/vibe/textfilter/markdown.d:540
540                                             dst.put(alstr[block.columns[i]]);
(gdb) bt
#0  0x00005555558f26fc in _D4vibe10textfilter8markdown__T10writeBlockTS3std5array__T8AppenderTAyaZQoZQBsFKQBkKxSQDgQDeQCv5BlockHQBiSQEaQDyQDp7LinkRefMCQEtQErQEi16MarkdownSettingsZv (settings=0x7fffffffdc20, links=..., block=..., dst=...)
    at /home/webfreak/.dub/packages/vibe-d-0.8.3/vibe-d/textfilter/vibe/textfilter/markdown.d:540
#1  0x00005555558f2278 in _D4vibe10textfilter8markdown__T10writeBlockTS3std5array__T8AppenderTAyaZQoZQBsFKQBkKxSQDgQDeQCv5BlockHQBiSQEaQDyQDp7LinkRefMCQEtQErQEi16MarkdownSettingsZv (settings=0x7fffffffdc20, links=..., block=..., dst=...)
    at /home/webfreak/.dub/packages/vibe-d-0.8.3/vibe-d/textfilter/vibe/textfilter/markdown.d:502
#2  0x00005555558f1683 in _D4vibe10textfilter8markdown__T14filterMarkdownTS3std5array__T8AppenderTAyaZQoZQBwFKQBkQpMCQDlQDjQDa16MarkdownSettingsZv (settings=0x7fffffffdc20, src=..., dst=...)
    at /home/webfreak/.dub/packages/vibe-d-0.8.3/vibe-d/textfilter/vibe/textfilter/markdown.d:75
#3  0x00005555558f15ba in _D4vibe10textfilter8markdown__T14filterMarkdownZQrFNeAyaMCQCeQCcQBt16MarkdownSettingsZQBh (
    settings=0x7fffffffdc20, str=...)
    at /home/webfreak/.dub/packages/vibe-d-0.8.3/vibe-d/textfilter/vibe/textfilter/markdown.d:52
#4  0x00005555558f1539 in _D4vibe10textfilter8markdown__T14filterMarkdownZQrFNeAyaEQCdQCbQBs13MarkdownFlagsZQBd (
    flags=<incomplete type>, str=...)
    at /home/webfreak/.dub/packages/vibe-d-0.8.3/vibe-d/textfilter/vibe/textfilter/markdown.d:46
#5  0x00005555558e74e8 in D main () at source/app.d:9

Code:

import vibe.vibe;

void main()
{
	string md = "| header | header |
|--------|--------|
|   a    | b  | c |";

	string html = filterMarkdown(md, MarkdownFlags.backtickCodeBlocks|MarkdownFlags.noInlineHtml|MarkdownFlags.tables);
}

@s-ludwig s-ludwig closed this in 945a684 Mar 24, 2018

s-ludwig added a commit that referenced this issue Mar 24, 2018

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