$OpenBSD: patch-src_main_connections_c,v 1.10 2012/10/29 11:07:29 dcoppa Exp $
--- src/main/connections.c.orig	Tue Aug 14 00:05:06 2012
+++ src/main/connections.c	Fri Oct 26 10:05:45 2012
@@ -2644,7 +2644,7 @@ static int text_vfprintf(Rconnection con, const char *
 	b = R_alloc(res + already + 1, sizeof(char));
 	strcpy(b, this->lastline);
 	p = b + already;
-	vsprintf(p, format, ap);
+	vsnprintf(p, res + already + 1, format, ap);
     } else if(res < 0) { /* just a failure indication */
 #define NBUFSIZE (already + 100*BUFSIZE)
 	usedRalloc = TRUE;
@@ -4872,7 +4872,8 @@ static Rboolean gzcon_open(Rconnection con)
 
     if(con->canread) {
 	/* read header */
-	char c, ccc, method, flags, dummy[6];
+	signed char c;
+	char ccc, method, flags, dummy[6];
 	unsigned char head[2];
 	uInt len;
 
