Mail archive
alpine-aports

[alpine-aports] [PATCH 2/3] main/mdocml: upgrade to 1.14.2

From: Daniel Sabogal <dsabogalcc_at_gmail.com>
Date: Tue, 1 Aug 2017 16:18:41 -0400

Include upstream patch that fixes an out-of-bounds read.
This can be triggered with mount(8) from util-linux.
---
 main/mdocml/APKBUILD               | 15 +++++++++------
 main/mdocml/man_term-fix.patch     | 26 ++++++++++++++++++++++++++
 main/mdocml/shared-libmandoc.patch | 35 ++++++++++++++---------------------
 3 files changed, 49 insertions(+), 27 deletions(-)
 create mode 100644 main/mdocml/man_term-fix.patch
diff --git a/main/mdocml/APKBUILD b/main/mdocml/APKBUILD
index facc8a0eaf..90ffcc4911 100644
--- a/main/mdocml/APKBUILD
+++ b/main/mdocml/APKBUILD
_at_@ -1,7 +1,8 @@
 # Maintainer:  Natanael Copa <ncopa_at_alpinelinux.org>
 pkgname=mdocml
-pkgver=1.14.1
-pkgrel=1
+_pkgname=mandoc
+pkgver=1.14.2
+pkgrel=0
 pkgdesc="mdoc/man compiler"
 url="http://mdocml.bsd.lv/"
 arch="all"
_at_@ -12,14 +13,15 @@ checkdepends="perl"
 install="$pkgname.post-deinstall"
 triggers="$pkgname-apropos.trigger=/usr/share/man/*"
 subpackages="$pkgname-doc $pkgname-dev man::noarch $pkgname-apropos $pkgname-soelim"
-source="http://mdocml.bsd.lv/snapshots/$pkgname-$pkgver.tar.gz
+source="http://mdocml.bsd.lv/snapshots/$_pkgname-$pkgver.tar.gz
 	shared-libmandoc.patch
 	pager.patch
+	man_term-fix.patch
 	mdocml-apropos.trigger
 	man.conf
 	"
 
-builddir="$srcdir/$pkgname-$pkgver"
+builddir="$srcdir/$_pkgname-$pkgver"
 prepare() {
 	default_prepare
 
_at_@ -79,8 +81,9 @@ soelim() {
 		"$subpkgdir"/usr/bin/
 }
 
-sha512sums="90f00297d162faa404fe4e530f95422c210b8d23a0be5a115c2c8c17255d366e224444901842affb06ed8aaf8febd3e5c79966ff713fa7daf00e8c48b7a857c6  mdocml-1.14.1.tar.gz
-ca0f68f6d3d67800eaae7649dacddd04b9159c636bc922840cdb30b741026e708a9527571af656b22642c83b2dc0f9cd9f0b83b43db7a64b0e15fb0654e935a6  shared-libmandoc.patch
+sha512sums="1691e4552b0417a30a3a546cff651665f8b4b3fbe2357c734546ca29c56eef9c971a6bd88daa170f4697fb50d14048138f4bc6f5ef55aa24a7ac03903d04c868  mandoc-1.14.2.tar.gz
+d127e635dfb54f9a88a28a8312f23495ec1e9356202e03ccfad1f7528f26f1cbfa7fc2c7b20c262523941d661fa7ba570a64a63c23f3e7fffc954d00bd5769c7  shared-libmandoc.patch
 04947a275df99298591c2a46fb81b74c7c3fcb9f3cf8fb718cf1e32eeae5409e90a3bca89e542f8aa1b30792e837fd3d716303a636d1a3ec165fbb9529546a64  pager.patch
+2d69ba396d05b2d1f0b91a3e31175f3a5bc306e334a341cd801b7b83a5cabf245a3f8228b5d7faded19e0c7d65bdfb31630613a9b780db49989599da0dbb3bfc  man_term-fix.patch
 704bc159acfc639e10c7d505372d303cb5784c8e9eb30084236ad89978978d4ba74f3127d4597d78594b64182c47a00c011f8bb3271d2b784f03a2a411ccb1d8  mdocml-apropos.trigger
 0723c32ab70e5b1c77768ca78d7437b26bed19b90b27876b10cc463359c41332befc0105fc1e23ceae48de5a892f1aa7ac60ef7eb0b6b8f1616726c4300632fe  man.conf"
diff --git a/main/mdocml/man_term-fix.patch b/main/mdocml/man_term-fix.patch
new file mode 100644
index 0000000000..0a5f435fb7
--- /dev/null
+++ b/main/mdocml/man_term-fix.patch
_at_@ -0,0 +1,26 @@
+--- mandoc-1.14.2/man_term.c.orig
++++ mandoc-1.14.2/man_term.c
+_at_@ -1,4 +1,4 @@
+-/*	$Id: man_term.c,v 1.208 2017/06/25 11:42:02 schwarze Exp $ */
++/*	$Id: man_term.c,v 1.209 2017/07/31 15:19:06 schwarze Exp $ */
+ /*
+  * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps_at_bsd.lv>
+  * Copyright (c) 2010-2015, 2017 Ingo Schwarze <schwarze_at_openbsd.org>
+_at_@ -673,7 +673,7 @@
+ 
+ 		do {
+ 			n = n->prev;
+-		} while (n != NULL && n->tok != TOKEN_NONE &&
++		} while (n != NULL && n->tok >= MAN_TH &&
+ 		    termacts[n->tok].flags & MAN_NOTEXT);
+ 		if (n == NULL || (n->tok == MAN_SS && n->body->child == NULL))
+ 			break;
+_at_@ -735,7 +735,7 @@
+ 
+ 		do {
+ 			n = n->prev;
+-		} while (n != NULL && n->tok != TOKEN_NONE &&
++		} while (n != NULL && n->tok >= MAN_TH &&
+ 		    termacts[n->tok].flags & MAN_NOTEXT);
+ 		if (n == NULL || (n->tok == MAN_SH && n->body->child == NULL))
+ 			break;
diff --git a/main/mdocml/shared-libmandoc.patch b/main/mdocml/shared-libmandoc.patch
index f01954fc94..819968ee6d 100644
--- a/main/mdocml/shared-libmandoc.patch
+++ b/main/mdocml/shared-libmandoc.patch
_at_@ -1,8 +1,8 @@
---- mdocml-1.14.1/Makefile.orig
-+++ mdocml-1.14.1/Makefile
-_at_@ -344,9 +344,13 @@
- WWW_OBJS	 = mdocml.tar.gz \
- 		   mdocml.sha256
+--- mandoc-1.14.2/Makefile.orig
++++ mandoc-1.14.2/Makefile
+_at_@ -347,9 +347,13 @@
+ 		   mdoc.h.html \
+ 		   roff.h.html
  
 +LIBMANDOC        = libmandoc.so
 +MANDOCLIB        = -L. -lmandoc
_at_@ -14,7 +14,7 @@
  
  # === DEPENDENCY HANDLING ==============================================
  
-_at_@ -369,7 +373,7 @@
+_at_@ -372,7 +376,7 @@
  	rm -f Makefile.local config.h config.h.old config.log config.log.old
  
  clean:
_at_@ -22,8 +22,8 @@
 +	rm -f $(LIBMANDOC) $(LIBMANDOC_OBJS) $(COMPAT_OBJS)
  	rm -f mandoc $(MAIN_OBJS)
  	rm -f man.cgi $(CGI_OBJS)
- 	rm -f mandocd catman $(MANDOCD_OBJS)
-_at_@ -410,11 +414,11 @@
+ 	rm -f mandocd catman catman.o $(MANDOCD_OBJS)
+_at_@ -411,11 +415,11 @@
  	$(INSTALL_MAN) makewhatis.8 \
  		$(DESTDIR)$(MANDIR)/man8/$(BINM_MAKEWHATIS).8
  
_at_@ -37,7 +37,7 @@
  	$(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h roff.h \
  		$(DESTDIR)$(INCLUDEDIR)
  	$(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \
-_at_@ -487,26 +491,26 @@
+_at_@ -488,23 +492,23 @@
  	_at_echo "$@ is out of date; please run ./configure"
  	_at_exit 1
  
_at_@ -51,30 +51,23 @@
 +mandoc: $(MAIN_OBJS) $(LIBMANDOC)
 +	$(CC) -o $_at_ $(LDFLAGS) $(MAIN_OBJS) $(MANDOCLIB) $(LDADD)
  
--manpage: $(MANPAGE_OBJS) libmandoc.a
--	$(CC) -o $_at_ $(LDFLAGS) $(MANPAGE_OBJS) libmandoc.a $(LDADD)
-+manpage: $(MANPAGE_OBJS) $(LIBMANDOC)
-+	$(CC) -o $_at_ $(LDFLAGS) $(MANPAGE_OBJS) $(MANDOCLIB) $(LDADD)
- 
--man.cgi: $(CGI_OBJS) libmandoc.a
--	$(CC) $(STATIC) -o $_at_ $(LDFLAGS) $(CGI_OBJS) libmandoc.a $(LDADD)
-+man.cgi: $(CGI_OBJS) $(LIBMANDOC)
-+	$(CC) $(STATIC) -o $_at_ $(LDFLAGS) $(CGI_OBJS) $(MANDOCLIB) $(LDADD)
+ man.cgi: $(CGI_OBJS) libmandoc.a
+ 	$(CC) $(STATIC) -o $_at_ $(LDFLAGS) $(CGI_OBJS) libmandoc.a $(LDADD)
  
 -mandocd: $(MANDOCD_OBJS) libmandoc.a
 -	$(CC) -o $_at_ $(LDFLAGS) $(MANDOCD_OBJS) libmandoc.a $(LDADD)
 +mandocd: $(MANDOCD_OBJS) $(LIBMANDOC)
-+	$(CC) -o $_at_ $(LDFLAGS) $(MANDOCD_OBJS) $(MANDOCLIB) $(LDADD)
++	$(CC) -o $_at_ $(LDFLAGS) $(MANDOCD_OBJS) $(LIBMANDOC) $(LDADD)
  
 -catman: catman.o libmandoc.a
 -	$(CC) -o $_at_ $(LDFLAGS) catman.o libmandoc.a $(LDADD)
 +catman: catman.o $(LIBMANDOC)
-+	$(CC) -o $_at_ $(LDFLAGS) catman.o $(MANDOCLIB) $(LDADD)
++	$(CC) -o $_at_ $(LDFLAGS) catman.o $(LIBMANDOC) $(LDADD)
  
 -demandoc: $(DEMANDOC_OBJS) libmandoc.a
 -	$(CC) -o $_at_ $(LDFLAGS) $(DEMANDOC_OBJS) libmandoc.a $(LDADD)
 +demandoc: $(DEMANDOC_OBJS) $(LIBMANDOC)
-+	$(CC) -o $_at_ $(LDFLAGS) $(DEMANDOC_OBJS) $(MANDOCLIB) $(LDADD)
++	$(CC) -o $_at_ $(LDFLAGS) $(DEMANDOC_OBJS) $(LIBMANDOC) $(LDADD)
  
  soelim: $(SOELIM_OBJS)
  	$(CC) -o $_at_ $(LDFLAGS) $(SOELIM_OBJS)
-- 
2.13.3
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Tue Aug 01 2017 - 16:18:41 GMT