$OpenBSD: patch-cgi_cgiutils_c,v 1.3 2008/04/18 11:08:47 sturm Exp $
--- cgi/cgiutils.c.orig	Mon Mar 31 21:09:34 2008
+++ cgi/cgiutils.c	Thu Apr 17 11:09:07 2008
@@ -1285,7 +1285,7 @@ char *mmap_fgets_multiline(mmapfile *temp_mmapfile){
 			}
 
 		/* one backslash found, so we should continue reading the next line */
-		else if(buf[end]=='\\')
+		else if(end>=0 && buf[end]=='\\')
 			buf[end]='\x0';
 
 		/* else no continuation marker was found, so break */
