diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2018-11-04 05:32:43 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2018-11-04 05:32:43 +0000 |
commit | ea36c4d60e761a9818f65e38dfa3d1d32ac8f318 (patch) | |
tree | 1b561e9a3532941617e106c54c736358a49b0c53 /usr.bin | |
parent | 289b44b1a26c4b4b0aedebd9e66aea866dc48167 (diff) |
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.
OK schwarze@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mandoc/dbm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/mandoc/dbm.c b/usr.bin/mandoc/dbm.c index 729f5310016..9989df4fab3 100644 --- a/usr.bin/mandoc/dbm.c +++ b/usr.bin/mandoc/dbm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dbm.c,v 1.3 2016/10/18 22:26:20 schwarze Exp $ */ +/* $OpenBSD: dbm.c,v 1.4 2018/11/04 05:32:42 bluhm Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> * @@ -141,17 +141,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; } |