(sieve_code_command): Avoid dead loop if a tag
is not given the argument it requires. Improve the diagnostics. Bug reported by Kostas Zorbadelos.
Showing
1 changed file
with
8 additions
and
0 deletions
... | @@ -194,6 +194,14 @@ sieve_code_command (mu_sieve_register_t *reg, mu_list_t arglist) | ... | @@ -194,6 +194,14 @@ sieve_code_command (mu_sieve_register_t *reg, mu_list_t arglist) |
194 | if (tag->argtype != SVT_VOID) | 194 | if (tag->argtype != SVT_VOID) |
195 | { | 195 | { |
196 | mu_iterator_next (itr); | 196 | mu_iterator_next (itr); |
197 | if (mu_iterator_is_done (itr)) | ||
198 | { | ||
199 | sieve_compile_error (sieve_filename, sieve_line_num, | ||
200 | _("required argument for tag %s is missing"), | ||
201 | tag->name); | ||
202 | err = 1; | ||
203 | break; | ||
204 | } | ||
197 | mu_iterator_current (itr, (void **)&tagrec.arg); | 205 | mu_iterator_current (itr, (void **)&tagrec.arg); |
198 | } | 206 | } |
199 | else | 207 | else | ... | ... |
-
Please register or sign in to post a comment