Browse code

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 authored on 29/09/2010 21:33:02
Showing 2 changed files
... ...
@@ -131,7 +131,7 @@ int event_parser(char* s, int len, event_t* e)
131 131
 		/* We have parameters to parse */
132 132
 		if (e->type == EVENT_DIALOG) {
133 133
 			pclass = CLASS_EVENT_DIALOG;
134
-			phooks = (param_hooks_t*)&e->params.dialog;
134
+			phooks = (param_hooks_t*)&e->params.hooks;
135 135
 		}
136 136
 
137 137
 		if (parse_params(&tmp, pclass, phooks, &e->params.list) < 0) {
... ...
@@ -48,7 +48,7 @@ enum event_type {
48 48
 
49 49
 
50 50
 struct event_params {
51
-	struct event_dialog_hooks dialog; /* Well known dialog package params */
51
+	param_hooks_t hooks; /* Well known dialog package params */
52 52
 	param_t* list; /* Linked list of all parsed parameters */
53 53
 };
54 54