boundary fix

This commit is contained in:
SJ 2013-08-22 00:33:39 +02:00
parent 7c507ed038
commit a9050a9f44
4 changed files with 20 additions and 3 deletions

View File

@ -14,7 +14,7 @@
#define VERSION "0.1.24-master-branch" #define VERSION "0.1.24-master-branch"
#define BUILD 833 #define BUILD 835
#define HOSTID "mailarchiver" #define HOSTID "mailarchiver"

View File

@ -131,6 +131,23 @@ struct node *findnode(struct node *xhash[], char *s){
} }
int is_substr_in_hash(struct node *xhash[], char *s){
int i;
struct node *q;
for(i=0;i<MAXHASH;i++){
q = xhash[i];
while(q != NULL){
if(q->str && strstr(s, q->str)) return 1;
q = q->r;
}
}
return 0;
}
inline int hash(unsigned int key){ inline int hash(unsigned int key){
return key % MAXHASH; return key % MAXHASH;
} }

View File

@ -14,6 +14,7 @@ void clearhash(struct node *xhash[]);
struct node *makenewnode(struct node *xhash[], char *s); struct node *makenewnode(struct node *xhash[], char *s);
int addnode(struct node *xhash[], char *s); int addnode(struct node *xhash[], char *s);
struct node *findnode(struct node *xhash[], char *s); struct node *findnode(struct node *xhash[], char *s);
int is_substr_in_hash(struct node *xhash[], char *s);
inline int hash(unsigned int key); inline int hash(unsigned int key);
unsigned int DJBHash(char* str, unsigned int len); unsigned int DJBHash(char* str, unsigned int len);

View File

@ -473,8 +473,7 @@ int parse_line(char *buf, struct _state *state, struct session_data *sdata, int
/* boundary check, and reset variables */ /* boundary check, and reset variables */
if(findnode(state->boundaries, buf)) boundary_line = 1; boundary_line = is_substr_in_hash(state->boundaries, buf);
if(!strstr(buf, "boundary=") && !strstr(buf, "boundary =") && boundary_line == 1){ if(!strstr(buf, "boundary=") && !strstr(buf, "boundary =") && boundary_line == 1){