Zero newly allocated space, to avoid (in some cases) passing an
unclean buffer to Perl_is_utf8_string which proceeds to strlen() it, causing an illegal access with malloc_flags J as it runs past the end of the 0xd0d0d0. Note there are various other problems with YAML::Syck and upstream recommend not using it - see the README file. ok jasper@
This commit is contained in:
parent
825e1c1581
commit
12bcff29c0
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.7 2010/05/31 01:59:37 kevlo Exp $
|
||||
# $OpenBSD: Makefile,v 1.8 2010/09/22 10:50:51 sthen Exp $
|
||||
|
||||
COMMENT= YAML and JSON for perl, optimized C
|
||||
|
||||
@ -6,6 +6,7 @@ SHARED_ONLY= Yes
|
||||
MODULES= cpan
|
||||
|
||||
DISTNAME= YAML-Syck-1.08
|
||||
REVISION= 0
|
||||
CATEGORIES= devel
|
||||
|
||||
# MIT
|
||||
|
15
devel/p5-YAML-Syck/patches/patch-syck_h
Normal file
15
devel/p5-YAML-Syck/patches/patch-syck_h
Normal file
@ -0,0 +1,15 @@
|
||||
$OpenBSD: patch-syck_h,v 1.1 2010/09/22 10:50:51 sthen Exp $
|
||||
|
||||
zeroing allocated space avoids a perl segfault with malloc_flags J.
|
||||
|
||||
--- syck.h.orig Wed Sep 22 10:22:37 2010
|
||||
+++ syck.h Wed Sep 22 10:23:24 2010
|
||||
@@ -75,7 +75,7 @@ extern "C" {
|
||||
|
||||
#define ALLOC_CT 8
|
||||
#define SYCK_BUFFERSIZE 4096
|
||||
-#define S_ALLOC_N(type,n) (type*)malloc(sizeof(type)*(n))
|
||||
+#define S_ALLOC_N(type,n) (type*)calloc((n),sizeof(type))
|
||||
#define S_ALLOC(type) (type*)malloc(sizeof(type))
|
||||
#define S_REALLOC_N(var,type,n) (var)=(type*)realloc((char*)(var),sizeof(type)*(n))
|
||||
#define S_FREE(n) free(n); n = NULL;
|
Loading…
x
Reference in New Issue
Block a user