From 67e9f0a62583b8441fd3e936a8e37d93b3106626 Mon Sep 17 00:00:00 2001 From: is Date: Wed, 6 Mar 2013 20:53:39 +0000 Subject: From upstream: replace undefined use of sscanf() in reading from POP server with simple parsing. Mutt flea #3636, changeset 6299:4c16c0d1ba9e --- mail/mutt-devel/Makefile | 4 ++-- mail/mutt-devel/distinfo | 4 +++- mail/mutt-devel/patches/patch-pop.c | 29 +++++++++++++++++++++++++++++ mail/mutt-devel/patches/patch-pop__lib.c | 29 +++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 mail/mutt-devel/patches/patch-pop.c create mode 100644 mail/mutt-devel/patches/patch-pop__lib.c (limited to 'mail/mutt-devel') diff --git a/mail/mutt-devel/Makefile b/mail/mutt-devel/Makefile index cf2a05e80fb..1b54000ecd0 100644 --- a/mail/mutt-devel/Makefile +++ b/mail/mutt-devel/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.91 2013/03/06 20:17:42 is Exp $ +# $NetBSD: Makefile,v 1.92 2013/03/06 20:53:39 is Exp $ DISTNAME= mutt-1.5.21 -PKGREVISION= 9 +PKGREVISION= 10 CATEGORIES= mail MUTT_SITES= ftp://ftp.mutt.org/mutt/ \ ftp://ftp.stealth.net/pub/mirrors/ftp.mutt.org/pub/mutt/ \ diff --git a/mail/mutt-devel/distinfo b/mail/mutt-devel/distinfo index fd97b4710b7..1e6e059a55a 100644 --- a/mail/mutt-devel/distinfo +++ b/mail/mutt-devel/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.74 2013/03/06 20:17:42 is Exp $ +$NetBSD: distinfo,v 1.75 2013/03/06 20:53:39 is Exp $ SHA1 (mutt-1.5.21.tar.gz) = a8475f2618ce5d5d33bff85c0affdf21ab1d76b9 RMD160 (mutt-1.5.21.tar.gz) = b235a42972ae410592253cdc117a90baf279f47a @@ -24,4 +24,6 @@ SHA1 (patch-ao) = a5dddb01d30f28337ca825c6461139c2d9f288d5 SHA1 (patch-ap) = c6f79d5c4e19efdc15e9d5a59934da52b16b7a62 SHA1 (patch-aq) = e363d8929ced9731a31af1137b111d3476a3d05d SHA1 (patch-lib.c) = 7a0dc485ac8351b4c41279e22cf74134462c6432 +SHA1 (patch-pop.c) = 943fec58724f4ea305fe2e4d1c48fa1c2945f087 +SHA1 (patch-pop__lib.c) = b183a9c75804189a14cdffbe2a19e52d29aa536a SHA1 (patch-smime.c) = 5ed07d69700992767572216844e44d655f5eec7d diff --git a/mail/mutt-devel/patches/patch-pop.c b/mail/mutt-devel/patches/patch-pop.c new file mode 100644 index 00000000000..b68ea9daee0 --- /dev/null +++ b/mail/mutt-devel/patches/patch-pop.c @@ -0,0 +1,29 @@ +$NetBSD: patch-pop.c,v 1.1 2013/03/06 20:53:39 is Exp $ + +Index: pop.c +=================================================================== +--- pop.c (revision 6288) ++++ pop.c (revision 6299) +@@ -34,4 +34,5 @@ + #include + #include ++#include + + #ifdef USE_HCACHE +@@ -142,6 +143,14 @@ + CONTEXT *ctx = (CONTEXT *)data; + POP_DATA *pop_data = (POP_DATA *)ctx->data; +- +- sscanf (line, "%d %s", &index, line); ++ char *endp; ++ ++ errno = 0; ++ index = strtol(line, &endp, 10); ++ if (errno) ++ return -1; ++ while (*endp == ' ') ++ endp++; ++ memmove(line, endp, strlen(endp) + 1); ++ + for (i = 0; i < ctx->msgcount; i++) + if (!mutt_strcmp (line, ctx->hdrs[i]->data)) diff --git a/mail/mutt-devel/patches/patch-pop__lib.c b/mail/mutt-devel/patches/patch-pop__lib.c new file mode 100644 index 00000000000..0a962a027f3 --- /dev/null +++ b/mail/mutt-devel/patches/patch-pop__lib.c @@ -0,0 +1,29 @@ +$NetBSD: patch-pop__lib.c,v 1.1 2013/03/06 20:53:39 is Exp $ + +Index: pop_lib.c +=================================================================== +--- pop_lib.c (revision 6235) ++++ pop_lib.c (revision 6299) +@@ -33,4 +33,5 @@ + #include + #include ++#include + + /* given an POP mailbox name, return host, port, username and password */ +@@ -524,6 +525,14 @@ + unsigned int index; + CONTEXT *ctx = (CONTEXT *)data; +- +- sscanf (line, "%u %s", &index, line); ++ char *endp; ++ ++ errno = 0; ++ index = strtoul(line, &endp, 10); ++ if (errno) ++ return -1; ++ while (*endp == ' ') ++ endp++; ++ memmove(line, endp, strlen(endp) + 1); ++ + for (i = 0; i < ctx->msgcount; i++) + { -- cgit v1.2.3