$OpenBSD: patch-socket_c,v 1.10 2017/08/11 04:18:19 bluhm Exp $

Reported upstream
  https://gitlab.com/fetchmail/fetchmail/merge_requests/5

Fixed upstream
  https://gitlab.com/fetchmail/fetchmail/commit/a2ae6f8d15d7caf815d7bdd13df833fd1b2af5cc

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
 		} else if(!strcasecmp("ssl3",myproto)) {
+#if HAVE_DECL_SSLV3_CLIENT_METHOD + 0 > 0
 			_ctx[sock] = SSL_CTX_new(SSLv3_client_method());
+#else
+			report(stderr, GT_("Your operating system does not support SSLv3.\n"));
+			return -1;
+#endif
 		} else if(!strcasecmp("tls1",myproto)) {
 			_ctx[sock] = SSL_CTX_new(TLSv1_client_method());
 		} else if (!strcasecmp("ssl23",myproto)) {
