Fix buffer overflows 1 element before and after buffer boundaries.

Fixes segfault on startup.

OK author, pval@.
This commit is contained in:
ray 2006-10-26 06:10:01 +00:00
parent ea93d319d1
commit 13990230e7
2 changed files with 14 additions and 1 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.7 2004/11/28 22:41:17 espie Exp $
# $OpenBSD: Makefile,v 1.8 2006/10/26 06:10:01 ray Exp $
COMMENT= "organic fireworks demo"
DISTNAME= fire-1.0
PKGNAME= ${DISTNAME}p0
CATEGORIES= games
HOMEPAGE= http://www.libsdl.org/projects/fire/

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-fire_c,v 1.1 2006/10/26 06:10:01 ray Exp $
--- fire.c.orig Tue Dec 21 00:19:06 1999
+++ fire.c Thu Aug 24 06:10:54 2006
@@ -105,7 +105,7 @@ unsigned char *p3, *p4;
for(y=2;y<YSIZE;y++)
{
- for(x=0;x<XSIZE;x++)
+ for(x=1;x<XSIZE - 1;x++)
{
p3 = p1+y*XSIZE+x;
p4 = p2+y*pitch+x;