source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: Properly reset the validation part of the tagging module between
@ 2020-03-13 16:17 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2020-03-13 16:17 UTC (permalink / raw)
  To: source

Log Message:
-----------
Properly reset the validation part of the tagging module between files.
This fixes a crash in makewhatis(8) encountered by naddy@.

Modified Files:
--------------
    mandoc:
        read.c
        tag.c

Revision Data
-------------
Index: read.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/read.c,v
retrieving revision 1.215
retrieving revision 1.216
diff -Lread.c -Lread.c -u -p -r1.215 -r1.216
--- read.c
+++ read.c
@@ -678,11 +678,13 @@ mparse_alloc(int options, enum mandoc_os
 void
 mparse_reset(struct mparse *curp)
 {
+	tag_free();
 	roff_reset(curp->roff);
 	roff_man_reset(curp->man);
 	free_buf_list(curp->secondary);
 	curp->secondary = NULL;
 	curp->gzip = 0;
+	tag_alloc();
 }
 
 void
Index: tag.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/tag.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -Ltag.c -Ltag.c -u -p -r1.28 -r1.29
--- tag.c
+++ tag.c
@@ -59,6 +59,8 @@ tag_free(void)
 	struct tag_entry	*entry;
 	unsigned int		 slot;
 
+	if (tag_data.info.free == NULL)
+		return;
 	entry = ohash_first(&tag_data, &slot);
 	while (entry != NULL) {
 		free(entry->nodes);
@@ -66,6 +68,7 @@ tag_free(void)
 		entry = ohash_next(&tag_data, &slot);
 	}
 	ohash_delete(&tag_data);
+	tag_data.info.free = NULL;
 }
 
 /*
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

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

only message in thread, other threads:[~2020-03-13 16:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-13 16:17 mandoc: Properly reset the validation part of the tagging module between 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).