On 11/03/17 19:20, Alexander Bluhm wrote:
> Hi,
> 
> I would like to fix this segmentation fault in p5-File-MMagic-XS.
> 
> ok?
> 
Sure ok for me.
 Cheers
  Giovanni

> bluhm
> 
> Index: misc/p5-File-MMagic-XS/Makefile
> ===================================================================
> RCS file: /data/mirror/openbsd/cvs/ports/misc/p5-File-MMagic-XS/Makefile,v
> retrieving revision 1.13
> diff -u -p -r1.13 Makefile
> --- misc/p5-File-MMagic-XS/Makefile   4 Aug 2017 09:27:03 -0000       1.13
> +++ misc/p5-File-MMagic-XS/Makefile   3 Nov 2017 18:15:32 -0000
> @@ -5,7 +5,7 @@ COMMENT =     guess file type with XS (a la 
>  MODULES =    cpan
>  DISTNAME =   File-MMagic-XS-0.09008
>  CATEGORIES = misc
> -REVISION =   1
> +REVISION =   2
>  
>  # Perl
>  PERMIT_PACKAGE_CDROM =               Yes
> Index: misc/p5-File-MMagic-XS/patches/patch-src_perl-mmagic-xs_c
> ===================================================================
> RCS file: misc/p5-File-MMagic-XS/patches/patch-src_perl-mmagic-xs_c
> diff -N misc/p5-File-MMagic-XS/patches/patch-src_perl-mmagic-xs_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ misc/p5-File-MMagic-XS/patches/patch-src_perl-mmagic-xs_c 3 Nov 2017 
> 18:15:13 -0000
> @@ -0,0 +1,22 @@
> +$OpenBSD$
> +
> +https://rt.cpan.org/Public/Bug/Display.html?id=123503
> +https://github.com/lestrrat/File-MMagic-XS/pull/6
> +
> +Index: src/perl-mmagic-xs.c
> +--- src/perl-mmagic-xs.c.orig
> ++++ src/perl-mmagic-xs.c
> +@@ -1616,10 +1616,10 @@ PerlFMM_bufmagic(PerlFMM *self, SV *buf)
> + 
> +     /* rt #28040, allow RV to SVs to be passed here */
> +     if (SvROK(buf) && SvTYPE(SvRV(buf)) == SVt_PV) {
> +-        buffer = (unsigned char *) SvPV_nolen( SvRV( buf ) );
> +-    } else {
> +-        buffer = (unsigned char *) SvPV_nolen(buf);
> ++        buf = SvRV(buf);
> +     }
> ++    SvGROW(buf, HOWMANY + 1);
> ++    buffer = (unsigned char *) SvPV_nolen(buf);
> + 
> +     FMM_SET_ERROR(self, NULL);
> + 
> 

Reply via email to