source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: mandoc: Correctly construct empty lists in dbm_page_get().
Date: Mon, 19 Nov 2018 14:22:37 -0500 (EST)	[thread overview]
Message-ID: <381d4be27c817699@fantadrom.bsd.lv> (raw)

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

                 reply	other threads:[~2018-11-19 19:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=381d4be27c817699@fantadrom.bsd.lv \
    --to=schwarze@mandoc.bsd.lv \
    --cc=source@mandoc.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).