source@mandoc.bsd.lv
 help / color / 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, back to index

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

source@mandoc.bsd.lv

Archives are clonable: git clone --mirror http://inbox.vuxu.org/mandoc-source

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.mandoc.source


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git