git-svn: trunk@2274
Nigel Horne authored on 2006/09/16 01:29:42... | ... |
@@ -1,3 +1,8 @@ |
1 |
+Fri Sep 15 17:28:24 BST 2006 (njh) |
|
2 |
+---------------------------------- |
|
3 |
+ * libclamav/phishcheck.c: Better way to find length of data to be |
|
4 |
+ scanned in str_strip() (reported by Edvin) |
|
5 |
+ |
|
1 | 6 |
Fri Sep 15 00:52:48 CEST 2006 (tk) |
2 | 7 |
---------------------------------- |
3 | 8 |
* freshclam: fix compilation error on systems without SO_ERROR defined, |
... | ... |
@@ -19,6 +19,9 @@ |
19 | 19 |
* MA 02110-1301, USA. |
20 | 20 |
* |
21 | 21 |
* $Log: phishcheck.c,v $ |
22 |
+ * Revision 1.3 2006/09/15 16:27:50 njh |
|
23 |
+ * Better way to find string length in str_strip |
|
24 |
+ * |
|
22 | 25 |
* Revision 1.2 2006/09/14 08:59:37 njh |
23 | 26 |
* Fixed some NULL pointers |
24 | 27 |
* |
... | ... |
@@ -215,7 +218,7 @@ For the Whitelist(.wdb)/Domainlist(.pdb) format see regex_list.c (search for Fla |
215 | 215 |
* |
216 | 216 |
*/ |
217 | 217 |
static char empty_string[]=""; |
218 |
-static char *rfind(const char *start, char c, size_t len); |
|
218 |
+static char *rfind(char *start, char c, size_t len); |
|
219 | 219 |
|
220 | 220 |
void url_check_init(struct url_check* urls) |
221 | 221 |
{ |
... | ... |
@@ -454,9 +457,9 @@ int isTLD(const char* str,int len) |
454 | 454 |
* memrchr isn't standard, so I use this |
455 | 455 |
*/ |
456 | 456 |
static char * |
457 |
-rfind(const char *start, char c, size_t len) |
|
457 |
+rfind(char *start, char c, size_t len) |
|
458 | 458 |
{ |
459 |
- const char *p; |
|
459 |
+ char *p; |
|
460 | 460 |
|
461 | 461 |
if(start == NULL) |
462 | 462 |
return NULL; |
... | ... |
@@ -629,7 +632,7 @@ str_strip(char **begin, const char **end, const char *what, size_t what_len) |
629 | 629 |
} |
630 | 630 |
|
631 | 631 |
/* strip trailing @what */ |
632 |
- if(what_len <= strlen(str_end)) { |
|
632 |
+ if(what_len <= (str_end - sbegin)) { |
|
633 | 633 |
str_end_what = str_end - what_len; |
634 | 634 |
while((str_end_what > sbegin) && |
635 | 635 |
(strncmp(str_end_what, what, what_len) == 0)) { |