Zero newly malloc'd address space, avoiding dereferencing a garbage pointer.

Found/patched by me, this version of the patch from upstream via Brad.
This commit is contained in:
sthen 2011-10-26 20:17:42 +00:00
parent 9396828adf
commit c3d32f8946
2 changed files with 14 additions and 2 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.2 2011/09/16 10:31:24 espie Exp $
# $OpenBSD: Makefile,v 1.3 2011/10/26 20:17:42 sthen Exp $
COMMENT= SWF manipulation and generation utilities
DISTNAME= swftools-0.9.1
REVISION= 0
REVISION= 1
CATEGORIES= multimedia
MASTER_SITES= ${HOMEPAGE}

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_swfstrings_c,v 1.1 2011/10/26 20:17:42 sthen Exp $
--- src/swfstrings.c.orig Wed Oct 26 11:07:47 2011
+++ src/swfstrings.c Wed Oct 26 10:59:47 2011
@@ -208,7 +208,7 @@ int main (int argc,char ** argv)
if(!h) h = (swf.movieSize.ymax - swf.movieSize.ymin) / 20;
}
- id2tag = malloc(sizeof(TAG)*65536);
+ id2tag = rfx_calloc(sizeof(TAG)*65536);
fontnum = 0;
swf_FontEnumerate(&swf,&fontcallback1, 0);