avoid holes in data-structures due to alignment.

git-svn: trunk@3459
remotes/push_mirror/metadata
Török Edvin 18 years ago
parent c71cae8cb2
commit 5a9a9989b8
  1. 5
      ChangeLog
  2. 2
      libclamav/phishcheck.h
  3. 8
      libclamav/regex_list.c
  4. 4
      libclamav/regex_list.h
  5. 10
      libclamav/rtf.c

@ -1,3 +1,8 @@
Fri Dec 28 13:53:33 EET 2007 (edwin)
------------------------------------
* libclamav/phishcheck.h, regex_list.[ch], rtf.c:
avoid holes in data-structures due to alignment.
Thu Dec 27 14:21:52 GMT 2007 (trog)
-----------------------------------
* libclamav/chmunpack.c: fix bb#740

@ -36,9 +36,9 @@ enum phish_status {CL_PHISH_NODECISION=0, CL_PHISH_CLEAN=CL_PHISH_BASE,
#define CL_PHISH_ALL_CHECKS (CLEANUP_URL|CHECK_SSL|CHECK_CLOAKING|CHECK_IMG_URL)
struct string {
int refcount;
struct string* ref;
char* data;
int refcount;
};
struct phishcheck {

@ -77,15 +77,15 @@ typedef unsigned char* char_bitmap_p;
*/
struct tree_node {
struct tree_node* next;/* next regex/complex sibling, or parent, if no more siblings , can't be NULL except for root node*/
unsigned char c;
enum token_op_t op;
char alternatives;/* number of (non-regex) children of node, i.e. sizeof(children)*/
char listend;/* no more siblings, next pointer is pointer to parent*/
union {
struct tree_node** children;/* alternatives nr. of children, followed by (a null pointer terminated) regex leaf node pointers) */
char_bitmap_p* bitmap;
struct leaf_info* leaf;
} u;
enum token_op_t op;
unsigned char c;
char alternatives;/* number of (non-regex) children of node, i.e. sizeof(children)*/
char listend;/* no more siblings, next pointer is pointer to parent*/
};
struct leaf_info {

@ -45,12 +45,12 @@ struct regex_matcher {
struct cli_matcher* root_hosts;
struct tree_node* root_regex;
struct tree_node* root_regex_hostonly;
struct node_stack node_stack;
struct node_stack node_stack_alt;
size_t root_hosts_cnt;
int list_inited;
int list_loaded;
int list_built;
struct node_stack node_stack;
struct node_stack node_stack_alt;
};
int regex_list_match(struct regex_matcher* matcher, char* real_url,const char* display_url,const struct pre_fixup_info* pre_fixup, int hostOnly,const char** info,int is_whitelist);

@ -50,6 +50,10 @@ typedef int (*rtf_callback_process)(struct rtf_state*, const unsigned char* data
typedef int (*rtf_callback_end)(struct rtf_state*, cli_ctx*);
struct rtf_state {
rtf_callback_begin cb_begin;/* must be non-null if you want cb_process, and cb_end to be called, also it must change cb_data to non-null */
rtf_callback_process cb_process;
rtf_callback_end cb_end;
void* cb_data;/* data set up by cb_begin, used by cb_process, and cleaned up by cb_end. typically state data */
size_t default_elements;
size_t controlword_cnt;
ssize_t controlword_param;
@ -57,14 +61,10 @@ struct rtf_state {
int controlword_param_sign;
int encounteredTopLevel;/* encountered top-level control words that we care about */
char controlword[33];
rtf_callback_begin cb_begin;/* must be non-null if you want cb_process, and cb_end to be called, also it must change cb_data to non-null */
rtf_callback_process cb_process;
rtf_callback_end cb_end;
void* cb_data;/* data set up by cb_begin, used by cb_process, and cleaned up by cb_end. typically state data */
};
static const struct rtf_state base_state = {
0,0,0,PARSE_MAIN,0,0," ",NULL,NULL,NULL,NULL
NULL,NULL,NULL,NULL,0,0,0,PARSE_MAIN,0,0," "
};
struct stack {

Loading…
Cancel
Save