Prevent the port from segfaulting under certain conditions.

PR:		116602
Approved by:	maintainer (mat)
This commit is contained in:
Anton Berezin 2007-10-04 18:57:40 +00:00
parent 53568324f1
commit aa934c0655
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=200839
2 changed files with 21 additions and 0 deletions

View file

@ -7,6 +7,7 @@
PORTNAME= HTML-Tidy
PORTVERSION= 1.08
PORTREVISION= 1
CATEGORIES= textproc www perl5
MASTER_SITES= CPAN
PKGNAMEPREFIX= p5-

View file

@ -0,0 +1,20 @@
$Id$
--- Tidy.xs.orig 2007-09-24 11:36:19.000000000 +0200
+++ Tidy.xs 2007-09-24 11:37:42.000000000 +0200
@@ -55,6 +55,7 @@ _tidy_messages(input, configfile, tidy_o
const char* newline;
int rc = 0;
PPCODE:
+ tidyBufInit(&errbuf);
rc = ( tidyOptSetValue( tdoc, TidyCharEncoding, "utf8" ) ? rc : -1 );
if ( (rc >= 0 ) && configfile && *configfile ) {
@@ -117,6 +118,8 @@ _tidy_clean(input, configfile, tidy_opti
const char* newline;
int rc = 0;
PPCODE:
+ tidyBufInit(&output);
+ tidyBufInit(&errbuf);
/* Set our default first. */
/* Don't word-wrap */
rc = ( tidyOptSetInt( tdoc, TidyWrapLen, 0 ) ? rc : -1 );