diff options
author | micha <micha@pkgsrc.org> | 2020-11-10 12:03:59 +0000 |
---|---|---|
committer | micha <micha@pkgsrc.org> | 2020-11-10 12:03:59 +0000 |
commit | 8386518b8a54e7899ccfb6a3973a57f007aa0cd7 (patch) | |
tree | 77550fc14b62133f25a14774841b0e3f594f12de | |
parent | ae3810cea2aae0a4c42385f6c0a004de06bd6afa (diff) | |
download | pkgsrc-8386518b8a54e7899ccfb6a3973a57f007aa0cd7.tar.gz |
news/leafnode: Backport patch from upcoming 1.11.12
Prevent stack overruns if /message.id contains filenames >= 1000.
Bump PKGREVISION.
-rw-r--r-- | news/leafnode/Makefile | 3 | ||||
-rw-r--r-- | news/leafnode/distinfo | 3 | ||||
-rw-r--r-- | news/leafnode/patches/patch-miscutil.c | 44 |
3 files changed, 48 insertions, 2 deletions
diff --git a/news/leafnode/Makefile b/news/leafnode/Makefile index 477b8abfef2..38609d55fe2 100644 --- a/news/leafnode/Makefile +++ b/news/leafnode/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.51 2020/01/26 05:26:26 rillig Exp $ +# $NetBSD: Makefile,v 1.52 2020/11/10 12:03:59 micha Exp $ DISTNAME= leafnode-1.11.11 +PKGREVISION= 1 CATEGORIES= news MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=leafnode/} EXTRACT_SUFX= .tar.bz2 diff --git a/news/leafnode/distinfo b/news/leafnode/distinfo index a68b78c164c..38d2193e9f1 100644 --- a/news/leafnode/distinfo +++ b/news/leafnode/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.20 2018/09/04 11:00:48 wiz Exp $ +$NetBSD: distinfo,v 1.21 2020/11/10 12:03:59 micha Exp $ SHA1 (leafnode-1.11.11.tar.bz2) = 8e84358748a26ff147ea28120e8b42f5f6deb936 RMD160 (leafnode-1.11.11.tar.bz2) = 78078216a49356250ff843044431a66a0b722ab7 @@ -6,4 +6,5 @@ SHA512 (leafnode-1.11.11.tar.bz2) = 3a476a32f2e59ed0812379efc2ad1964347094417e7f Size (leafnode-1.11.11.tar.bz2) = 500482 bytes SHA1 (patch-Makefile.in) = 5ca379bc986a971c27c3287559c7294f7a4e92de SHA1 (patch-checkpeerlocal.c) = a2754f43c6153ce2f781880ed5bac3b90e72954c +SHA1 (patch-miscutil.c) = db32f666272c46e7b580d459094178631f275653 SHA1 (patch-xoverutil.c) = eb7c181aa033a587f53d66cd4d05791c60f49a7c diff --git a/news/leafnode/patches/patch-miscutil.c b/news/leafnode/patches/patch-miscutil.c new file mode 100644 index 00000000000..624159983dc --- /dev/null +++ b/news/leafnode/patches/patch-miscutil.c @@ -0,0 +1,44 @@ +$NetBSD: patch-miscutil.c,v 1.1 2020/11/10 12:03:59 micha Exp $ + +Leafnode no longer trashes the stack if it, while scanning the message.id +directory, finds a directory with an all-numeric name that is 1000 or higher. +https://gitlab.com/leafnode-2/leafnode-1/-/commit/33e7e308d60d774b7f67c1a59851ce3718ed0355 + +--- miscutil.c.orig 2013-06-10 18:16:31.000000000 +0000 ++++ miscutil.c +@@ -63,13 +63,16 @@ static const mode_t default_umask = 0002 + struct xoverinfo *xoverinfo; + unsigned long xfirst, xlast; + ++/* kludge around C89 const not being a compile-time constant */ ++enum { hashsize = 1000 }; ++ + static int + createmsgiddir(void) { + mastr *dir = mastr_new(1024); + mastr *mid = mastr_new(1024); + DIR *d; + int rc = 0; +- int havedir[1000] = {0}; ++ int havedir[hashsize] = {0}; + + mastr_vcat(dir, spooldir, "/message.id", NULL); + d = opendir(mastr_str(dir)); +@@ -84,7 +87,7 @@ createmsgiddir(void) { + t = de->d_name; + if (isdigit((unsigned char)*t)) { + u = strtoul(t, &e, 10); +- if (e > t) ++ if (e > t && u < hashsize) + havedir[u] = 1; + } + } +@@ -96,7 +99,7 @@ createmsgiddir(void) { + closedir(d); + + /* create missing */ +- for(u = 0; u < 1000; u++) { ++ for(u = 0; u < hashsize; u++) { + char b[4]; + + snprintf(b, sizeof(b), "%03lu", u); |