source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Do not access a NULL pointer when a .Bd macro has no arguments
@ 2015-10-30 18:54 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2015-10-30 18:54 UTC (permalink / raw)
  To: source

Log Message:
-----------
Do not access a NULL pointer when a .Bd macro has no arguments at all.
Bug reported by krw@.

Modified Files:
--------------
    mdocml:
        mdoc_state.c

Revision Data
-------------
Index: mdoc_state.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mdoc_state.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lmdoc_state.c -Lmdoc_state.c -u -p -r1.2 -r1.3
--- mdoc_state.c
+++ mdoc_state.c
@@ -195,6 +195,9 @@ state_bd(STATE_ARGS)
 	    (n->type != ROFFT_BODY || n->end != ENDBODY_NOT))
 		return;
 
+	if (n->parent->args == NULL)
+		return;
+
 	arg = n->parent->args->argv[0].arg;
 	if (arg != MDOC_Literal && arg != MDOC_Unfilled)
 		return;
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-30 18:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-30 18:54 mdocml: Do not access a NULL pointer when a .Bd macro has no arguments 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).