aboutsummaryrefslogtreecommitdiff
path: root/www/dansguardian
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2012-07-05 14:27:30 +0000
committerRenato Botelho <garga@FreeBSD.org>2012-07-05 14:27:30 +0000
commit79226459e28abf39bb254fe78be4601c476d1668 (patch)
tree9b753dc871602bb605da6aa651762f3de07ffa79 /www/dansguardian
parent9a46db562a4bd3e9aac1c0e587f6da2584fe87e4 (diff)
downloadports-79226459e28abf39bb254fe78be4601c476d1668.tar.gz
ports-79226459e28abf39bb254fe78be4601c476d1668.zip
Notes
Diffstat (limited to 'www/dansguardian')
-rw-r--r--www/dansguardian/Makefile2
-rw-r--r--www/dansguardian/files/patch-src__RegEx.cpp40
-rw-r--r--www/dansguardian/files/patch-src__RegExp.hpp10
3 files changed, 51 insertions, 1 deletions
diff --git a/www/dansguardian/Makefile b/www/dansguardian/Makefile
index 370d5db7b65c..e3a57061eaa1 100644
--- a/www/dansguardian/Makefile
+++ b/www/dansguardian/Makefile
@@ -7,7 +7,7 @@
PORTNAME= dansguardian
PORTVERSION= 2.10.1.1
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= www
MASTER_SITES= # empty, see below
diff --git a/www/dansguardian/files/patch-src__RegEx.cpp b/www/dansguardian/files/patch-src__RegEx.cpp
new file mode 100644
index 000000000000..59c433265200
--- /dev/null
+++ b/www/dansguardian/files/patch-src__RegEx.cpp
@@ -0,0 +1,40 @@
+--- src/RegExp.cpp.orig 2008-11-18 11:27:04.000000000 +0000
++++ src/RegExp.cpp 2012-07-05 09:03:46.555469692 +0100
+@@ -161,14 +161,17 @@
+ offsets.clear();
+ lengths.clear();
+ imatched = false;
+- regmatch_t *pmatch = new regmatch_t[reg.re_nsub + 1]; // to hold result
++ int num_sub_expressions = MAX_SUB_EXPRESSIONS;
++ if(reg.re_nsub < num_sub_expressions)
++ num_sub_expressions = reg.re_nsub;
++ regmatch_t *pmatch = new regmatch_t[num_sub_expressions + 1]; // to hold result
+ if (!pmatch) { // if it failed
+ delete[]pmatch;
+ imatched = false;
+ return false;
+ // exception?
+ }
+- if (regexec(&reg, pos, reg.re_nsub + 1, pmatch, 0)) { // run regex
++ if (regexec(&reg, pos, num_sub_expressions + 1, pmatch, 0)) { // run regex
+ delete[]pmatch;
+ imatched = false;
+ // #ifdef DGDEBUG
+@@ -182,7 +185,7 @@
+ int error = 0;
+ while (error == 0) {
+ largestoffset = 0;
+- for (i = 0; i <= (signed) reg.re_nsub; i++) {
++ for (i = 0; i <= (signed) num_sub_expressions; i++) {
+ if (pmatch[i].rm_so != -1) {
+ matchlen = pmatch[i].rm_eo - pmatch[i].rm_so;
+ submatch = new char[matchlen + 1];
+@@ -199,7 +202,7 @@
+ }
+ if (largestoffset > 0) {
+ pos += largestoffset;
+- error = regexec(&reg, pos, reg.re_nsub + 1, pmatch, REG_NOTBOL);
++ error = regexec(&reg, pos, num_sub_expressions + 1, pmatch, REG_NOTBOL);
+ } else {
+ error = -1;
+ }
diff --git a/www/dansguardian/files/patch-src__RegExp.hpp b/www/dansguardian/files/patch-src__RegExp.hpp
new file mode 100644
index 000000000000..a16451789087
--- /dev/null
+++ b/www/dansguardian/files/patch-src__RegExp.hpp
@@ -0,0 +1,10 @@
+--- src/RegExp.hpp.orig 2008-11-18 11:27:04.000000000 +0000
++++ src/RegExp.hpp 2012-07-05 09:03:46.555469692 +0100
+@@ -22,6 +22,7 @@
+ #ifndef __HPP_REGEXP
+ #define __HPP_REGEXP
+
++#define MAX_SUB_EXPRESSIONS 1024
+
+ // INCLUDES
+