source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: Correctly construct empty lists in dbm_page_get().
@ 2018-11-19 19:22 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2018-11-19 19:22 UTC (permalink / raw)
  To: source

Log Message:
-----------
Correctly construct empty lists in dbm_page_get().                      

Original commit message by the author of this bugfix patch, bluhm@:

lstmatch() expects a list of strings separated by \0 and terminated
with \0\0.  In the NULL case dbm_page_get() returned only simple
strings so correct processing was depending on data layout.  Use
an additional \0 to terminate the single string lists.  Found by
mandoc regress since llvm linker on amd64 arranges strings differently.

Modified Files:
--------------
    mandoc:
        dbm.c

Revision Data
-------------
Index: dbm.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/dbm.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -Ldbm.c -Ldbm.c -u -p -r1.5 -r1.6
--- dbm.c
+++ dbm.c
@@ -151,17 +151,17 @@ dbm_page_get(int32_t ip)
 	assert(ip < npages);
 	res.name = dbm_get(pages[ip].name);
 	if (res.name == NULL)
-		res.name = "(NULL)";
+		res.name = "(NULL)\0";
 	res.sect = dbm_get(pages[ip].sect);
 	if (res.sect == NULL)
-		res.sect = "(NULL)";
+		res.sect = "(NULL)\0";
 	res.arch = pages[ip].arch ? dbm_get(pages[ip].arch) : NULL;
 	res.desc = dbm_get(pages[ip].desc);
 	if (res.desc == NULL)
 		res.desc = "(NULL)";
 	res.file = dbm_get(pages[ip].file);
 	if (res.file == NULL)
-		res.file = " (NULL)";
+		res.file = " (NULL)\0";
 	res.addr = dbm_addr(pages + ip);
 	return &res;
 }
--
 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:[~2018-11-19 19:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-19 19:22 mandoc: Correctly construct empty lists in dbm_page_get() 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).