Browse Source

core: event_t uses param_hooks_t

- parse_params() requires a param_hooks_t field since it memsets it to
  0, previously, the dialog specific hooks structure had a shorter size
  resulting in buffer overflow
Daniel-Constantin Mierla 15 years ago
parent
commit
80b1421caf
2 changed files with 2 additions and 2 deletions
  1. 1 1
      parser/parse_event.c
  2. 1 1
      parser/parse_event.h

+ 1 - 1
parser/parse_event.c

@@ -131,7 +131,7 @@ int event_parser(char* s, int len, event_t* e)
 		/* We have parameters to parse */
 		/* We have parameters to parse */
 		if (e->type == EVENT_DIALOG) {
 		if (e->type == EVENT_DIALOG) {
 			pclass = CLASS_EVENT_DIALOG;
 			pclass = CLASS_EVENT_DIALOG;
-			phooks = (param_hooks_t*)&e->params.dialog;
+			phooks = (param_hooks_t*)&e->params.hooks;
 		}
 		}
 
 
 		if (parse_params(&tmp, pclass, phooks, &e->params.list) < 0) {
 		if (parse_params(&tmp, pclass, phooks, &e->params.list) < 0) {

+ 1 - 1
parser/parse_event.h

@@ -48,7 +48,7 @@ enum event_type {
 
 
 
 
 struct event_params {
 struct event_params {
-	struct event_dialog_hooks dialog; /* Well known dialog package params */
+	param_hooks_t hooks; /* Well known dialog package params */
 	param_t* list; /* Linked list of all parsed parameters */
 	param_t* list; /* Linked list of all parsed parameters */
 };
 };