Re: fetchmail segfault fix

2017-08-10 Thread Jeremie Courreges-Anglas
On Thu, Aug 10 2017, Alexander Bluhm  wrote:
> Hi,
>
> I see sporadic crashes in fetchmail I would like to fix.
>
> ok?

Looks right, ok jca@

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



fetchmail segfault fix

2017-08-10 Thread Alexander Bluhm
Hi,

I see sporadic crashes in fetchmail I would like to fix.

ok?

bluhm

Index: mail/fetchmail/Makefile
===
RCS file: /data/mirror/openbsd/cvs/ports/mail/fetchmail/Makefile,v
retrieving revision 1.148
diff -u -p -r1.148 Makefile
--- mail/fetchmail/Makefile 2 Nov 2015 11:56:54 -   1.148
+++ mail/fetchmail/Makefile 10 Aug 2017 17:37:03 -
@@ -5,7 +5,7 @@ COMMENT=mail retrieval utility for POP2
 DISTNAME=  fetchmail-6.3.26
 CATEGORIES=mail
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=fetchmail/}
-REVISION=  0
+REVISION=  1
 
 HOMEPAGE=  http://www.fetchmail.info/
 
Index: mail/fetchmail/patches/patch-socket_c
===
RCS file: /data/mirror/openbsd/cvs/ports/mail/fetchmail/patches/patch-socket_c,v
retrieving revision 1.9
diff -u -p -r1.9 patch-socket_c
--- mail/fetchmail/patches/patch-socket_c   25 Aug 2015 17:44:09 -  
1.9
+++ mail/fetchmail/patches/patch-socket_c   10 Aug 2017 17:59:59 -
@@ -1,11 +1,23 @@
 $OpenBSD: patch-socket_c,v 1.9 2015/08/25 17:44:09 jca Exp $
 
-Fixed upstream
+Reported upstream
+  https://gitlab.com/fetchmail/fetchmail/merge_requests/5
 
+Fixed upstream
   
https://gitlab.com/fetchmail/fetchmail/commit/a2ae6f8d15d7caf815d7bdd13df833fd1b2af5cc
 
 socket.c.orig  Fri Jul 17 22:01:09 2015
-+++ socket.c   Fri Jul 17 22:19:47 2015
+Index: socket.c
+--- socket.c.orig
 socket.c
+@@ -111,7 +111,7 @@ static char *const *parse_plugin(const char *plugin, c
+   return NULL;
+   }
+ 
+-  while (plugin_copy_offset < plugin_copy_len)
++  while (plugin_offset < plugin_len && plugin_copy_offset < 
plugin_copy_len)
+   {   if ((plugin[plugin_offset] == '%') && (plugin[plugin_offset + 
1] == 'h'))
+   {   strcpy(plugin_copy + plugin_copy_offset, host);
+   plugin_offset += 2;
 @@ -914,7 +914,12 @@ int SSLOpen(int sock, char *mycert, char *mykey, const
return -1;
  #endif