Merge pull request #52 from spladug/safelink_segfault

Fix segfault doing SAFELINK check on empty links during HTML render.
This commit is contained in:
Vicent Martí 2011-08-08 11:40:53 -07:00
commit 03d2e3efa3

View file

@ -300,7 +300,7 @@ rndr_link(struct buf *ob, struct buf *link, struct buf *title, struct buf *conte
{
struct html_renderopt *options = opaque;
if ((options->flags & HTML_SAFELINK) != 0 && !sd_autolink_issafe(link->data, link->size))
if (link != NULL && (options->flags & HTML_SAFELINK) != 0 && !sd_autolink_issafe(link->data, link->size))
return 0;
BUFPUTSL(ob, "<a href=\"");