$OpenBSD: patch-src_main_connections_c,v 1.3 2005/10/08 09:47:37 mbalmer Exp $
--- src/main/connections.c.orig	Sat Jun 18 04:05:02 2005
+++ src/main/connections.c	Wed Aug 10 15:41:07 2005
@@ -190,7 +190,7 @@ int dummy_vfprintf(Rconnection con, cons
     if(res >= BUFSIZE) { /* res is the desired output length */
 	usedRalloc = TRUE;
 	b = R_alloc(res + 1, sizeof(char));
-	vsprintf(b, format, ap);
+	vsnprintf(b, res + 1, format, ap);
     } else if(res < 0) { /* just a failure indication -- e.g. Windows */
 	usedRalloc = TRUE;
 	b = R_alloc(100*BUFSIZE, sizeof(char));
@@ -3497,7 +3497,8 @@ static Rboolean gzcon_open(Rconnection c
 
     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;
 
