$OpenBSD: patch-src_main_connections_c,v 1.5 2007/08/09 22:22:17 steven Exp $
--- src/main/connections.c.orig	Mon Apr  9 04:05:02 2007
+++ src/main/connections.c	Thu Aug  9 00:44:00 2007
@@ -1900,7 +1900,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 -- e.g. Windows */
 #define NBUFSIZE (already + 100*BUFSIZE)
 	usedRalloc = TRUE;
@@ -3817,7 +3817,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;
 
