From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id d38e2809 for ; Mon, 19 Nov 2018 14:22:37 -0500 (EST) Date: Mon, 19 Nov 2018 14:22:37 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: Correctly construct empty lists in dbm_page_get(). X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-Id: <381d4be27c817699@fantadrom.bsd.lv> 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