pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/mutt-devel From upstream: replace undefined use o...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ed4ba5a3ea55
branches:  trunk
changeset: 615483:ed4ba5a3ea55
user:      is <is%pkgsrc.org@localhost>
date:      Wed Mar 06 20:53:39 2013 +0000

description:
>From upstream: replace undefined use of sscanf() in reading from POP
server with simple parsing.
Mutt flea #3636, changeset 6299:4c16c0d1ba9e

diffstat:

 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(-)

diffs (95 lines):

diff -r 2ca87b4890d2 -r ed4ba5a3ea55 mail/mutt-devel/Makefile
--- a/mail/mutt-devel/Makefile  Wed Mar 06 20:17:42 2013 +0000
+++ b/mail/mutt-devel/Makefile  Wed Mar 06 20:53:39 2013 +0000
@@ -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 -r 2ca87b4890d2 -r ed4ba5a3ea55 mail/mutt-devel/distinfo
--- a/mail/mutt-devel/distinfo  Wed Mar 06 20:17:42 2013 +0000
+++ b/mail/mutt-devel/distinfo  Wed Mar 06 20:53:39 2013 +0000
@@ -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-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 -r 2ca87b4890d2 -r ed4ba5a3ea55 mail/mutt-devel/patches/patch-pop.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/mutt-devel/patches/patch-pop.c       Wed Mar 06 20:53:39 2013 +0000
@@ -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 <string.h>
+ #include <unistd.h>
++#include <errno.h>
+ 
+ #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 -r 2ca87b4890d2 -r ed4ba5a3ea55 mail/mutt-devel/patches/patch-pop__lib.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/mutt-devel/patches/patch-pop__lib.c  Wed Mar 06 20:53:39 2013 +0000
@@ -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 <ctype.h>
+ #include <netdb.h>
++#include <errno.h>
+ 
+ /* 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++)
+   {



Home | Main Index | Thread Index | Old Index