Browse code

workaround Solaris problem with regexec() [bb #598]

git-svn: trunk@3165

Török Edvin authored on 2007/08/09 02:11:37
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Wed Aug  8 19:26:30 CEST 2007 (edwin)
2
+----------------------------------
3
+  * libclamav/phishcheck.c: workaround Solaris problem with regexec() [bb
4
+  #598]
5
+
1 6
 Mon Aug  6 13:16:39 CEST 2007 (tk)
2 7
 ----------------------------------
3 8
   * libclamav/matcher-ac.c: fix matching of patterns with prefixes and some
... ...
@@ -141,12 +141,11 @@ For the Whitelist(.wdb)/Domainlist(.pdb) format see regex_list.c (search for Fla
141 141
 /* Constant strings and tables */ 
142 142
 static char empty_string[]="";
143 143
 
144
-#define ANY_CLOAK "(((0[xX])?[a-fA-F0-9])+\\.?)+"
145
-#define CLOAK_REGEX_HEXURL "("ANY_CLOAK")?0[xX][a-fA-F0-9]+\\.?"ANY_CLOAK
146
-#define OCTAL_CLOAK "("ANY_CLOAK")?000[0-9]+\\.?"ANY_CLOAK
147
-#define DWORD_CLOAK "[0-9]{8,}"
148 144
 
149
-static const char cloaked_host_regex[] = "^(("CLOAK_REGEX_HEXURL")|("OCTAL_CLOAK")|("DWORD_CLOAK"))$";
145
+#define ANY_CLOAK "(0[xX][0-9a-fA-F]+|[0-9]+)"
146
+#define CLOAKED_URL "^"ANY_CLOAK"(\\."ANY_CLOAK"){0,3}$"
147
+
148
+static const char cloaked_host_regex[] = CLOAKED_URL;
150 149
 static const char tld_regex[] = "^"iana_tld"$";
151 150
 static const char cctld_regex[] = "^"iana_cctld"$";
152 151
 static const char dotnet[] = ".net";