Commit c57e7377 c57e7377fade2ad430478014ddfec815ec94004b by Sergey Poznyakoff

Bugfix

* libsieve/prog.c (mu_sv_code_command): Ensure tag arguments have
the proper type.
1 parent 887d5d3f
1 2008-10-24 Sergey Poznyakoff <gray@gnu.org.ua> 1 2008-10-24 Sergey Poznyakoff <gray@gnu.org.ua>
2 2
3 * libsieve/prog.c (mu_sv_code_command): Ensure tag arguments have
4 the proper type.
5
3 Fix handling of stdin stream (in particular, in sieve). 6 Fix handling of stdin stream (in particular, in sieve).
4 7
5 * libsieve/extensions/spamd.c (spamd_test): Fix typo. 8 * libsieve/extensions/spamd.c (spamd_test): Fix typo.
......
...@@ -203,6 +203,20 @@ mu_sv_code_command (mu_sieve_register_t *reg, mu_list_t arglist) ...@@ -203,6 +203,20 @@ mu_sv_code_command (mu_sieve_register_t *reg, mu_list_t arglist)
203 break; 203 break;
204 } 204 }
205 mu_iterator_current (itr, (void **)&tagrec.arg); 205 mu_iterator_current (itr, (void **)&tagrec.arg);
206 if (tagrec.arg->type != tag->argtype)
207 {
208 mu_sv_compile_error (&mu_sieve_locus,
209 _("type mismatch in argument to "
210 "tag `%s'"),
211 tag->name);
212 mu_sv_compile_error (&mu_sieve_locus,
213 _("expected %s but passed %s"),
214 mu_sieve_type_str (tag->argtype),
215 mu_sieve_type_str
216 (tagrec.arg->type));
217 err = 1;
218 break;
219 }
206 } 220 }
207 else 221 else
208 tagrec.arg = NULL; 222 tagrec.arg = NULL;
......