tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* [docbook2mdoc] Segfault encountering href attr in xml preamble(s)
@ 2019-04-19  4:28 Stephen Gregoratto
  2019-04-20  4:28 ` Ingo Schwarze
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Gregoratto @ 2019-04-19  4:28 UTC (permalink / raw)
  To: tech

I tried testing the new 1.0.0 release on some of my files and came 
across this bug. Some refentry files encode their chosen xsl stylesheet 
by putting it in the file itself. I believe this is to help converters 
like xmlto(1). The format is:

<?xml-stylesheet type="text/xsl"
   href="http://foo.tld/bar.xsl"?>

When docbook2mdoc encounters the href attribute, it eventually calls 
xml_attrkey() in parse.c, failing in the TAILQ_INSERT_TAIL macro. Having 
stepped through the code in GDB, I believe this is because the queue 
hasn't been allocated yet.

I also realised that this happens on any xml declaration. The smallest - 
and of course invalid - file that triggers this behaviour is:

  <?xml href="foo"?>

or even smaller:

  <? href="foo"?>
-- 
Stephen Gregoratto
PGP: 3FC6 3D0E 2801 C348 1C44 2D34 A80C 0F8E 8BAB EC8B
--
 To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-20  4:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-19  4:28 [docbook2mdoc] Segfault encountering href attr in xml preamble(s) Stephen Gregoratto
2019-04-20  4:28 ` Ingo Schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).