Browse code

fix crash in phishing code on database reload (Edvin Torok)

git-svn: trunk@2353

Tomasz Kojm authored on 2006/10/09 03:55:15
Showing 3 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sun Oct  8 20:51:40 CEST 2006 (tk)
2
+----------------------------------
3
+  * libclamav: fix crash in phishing code on database reload (Edvin Torok)
4
+
1 5
 Sun Oct  8 13:57:33 BST 2006 (njh)
2 6
 ----------------------------------
3 7
   * libclamav/js.c:	Finished first draft of the extraction phase
... ...
@@ -19,6 +19,9 @@
19 19
  *  MA 02110-1301, USA.
20 20
  *
21 21
  *  $Log: phishcheck.c,v $
22
+ *  Revision 1.12  2006/10/08 18:55:15  tkojm
23
+ *  fix crash in phishing code on database reload (Edvin Torok)
24
+ *
22 25
  *  Revision 1.11  2006/10/07 11:00:46  tkojm
23 26
  *  make the experimental anti-phishing code more thread safe
24 27
  *
... ...
@@ -1068,8 +1071,10 @@ void phishing_done(struct cl_engine* engine)
1068 1068
 	free_regex(&preg_cctld);
1069 1069
 	free_regex(&preg_tld);
1070 1070
 	free_regex(&preg_numeric);
1071
-	if(url_regex)
1071
+	if(url_regex) {
1072 1072
 		free(url_regex);
1073
+		url_regex = NULL;
1074
+	}
1073 1075
 
1074 1076
 	whitelist_done(engine);
1075 1077
 	domainlist_done(engine);
... ...
@@ -19,6 +19,9 @@
19 19
  *  MA 02110-1301, USA.
20 20
  *
21 21
  *  $Log: regex_list.c,v $
22
+ *  Revision 1.8  2006/10/08 18:55:15  tkojm
23
+ *  fix crash in phishing code on database reload (Edvin Torok)
24
+ *
22 25
  *  Revision 1.7  2006/10/07 11:00:46  tkojm
23 26
  *  make the experimental anti-phishing code more thread safe
24 27
  *
... ...
@@ -226,8 +229,12 @@ void setup_matcher_engine(void)
226 226
 void matcher_engine_done(void)
227 227
 {
228 228
 	size_t i;
229
-	for(i=0;i<std_class_cnt;i++)
229
+	for(i=0;i<std_class_cnt;i++) {
230
+		if(char_class_bitmap[i]) {
230 231
 			free(char_class_bitmap[i]);
232
+			char_class_bitmap[i] = NULL;
233
+		}
234
+	}
231 235
 	engine_ok = 0;
232 236
 }
233 237