crash on invalid config file

View: New views
3 Messages — Rating Filter:   Alert me  

crash on invalid config file

by Simon Josefsson-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, I noticed this crash when using an invalid configuration file:

jas@mocca:~/src/mailutils/imap4d master$ cat /home/jas/src/www-gsasl/test-server/imap4d.rc server {
  transcript true;
}
jas@mocca:~/src/mailutils/imap4d master$ ./imap4d --config-file /home/jas/src/www-gsasl/test-server/imap4d.rc
Segmentation fault
jas@mocca:~/src/mailutils/imap4d master$

/Simon


_______________________________________________
Bug-mailutils mailing list
Bug-mailutils@...
http://lists.gnu.org/mailman/listinfo/bug-mailutils

Re: crash on invalid config file

by Sergey Poznyakoff-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Simon,

> Hi, I noticed this crash when using an invalid configuration file:
>
> jas@mocca:~/src/mailutils/imap4d master$ cat /home/jas/src/www-gsasl/test-server/imap4d.rc server {
>   transcript true;
> }

Thanks! Here's the fix:

diff --git a/mailbox/msrv.c b/mailbox/msrv.c
index a318371..13a85d4 100644
--- a/mailbox/msrv.c
+++ b/mailbox/msrv.c
@@ -970,7 +970,7 @@ server_section_parser (enum mu_cfg_section_stage stage,
     {
     case mu_cfg_section_start:
       {
- if (node->label->type != MU_CFG_STRING)
+ if (node->label == NULL || node->label->type != MU_CFG_STRING)
   return 1;
  /* FIXME: should not modify 2nd arg, or it should not be const */
  return server_block_begin (tree->debug, node->label->v.string,

Regards,
Sergey


_______________________________________________
Bug-mailutils mailing list
Bug-mailutils@...
http://lists.gnu.org/mailman/listinfo/bug-mailutils

Re: crash on invalid config file

by Simon Josefsson-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sergey Poznyakoff <gray@...> writes:

> Hi Simon,
>
>> Hi, I noticed this crash when using an invalid configuration file:
>>
>> jas@mocca:~/src/mailutils/imap4d master$ cat /home/jas/src/www-gsasl/test-server/imap4d.rc server {
>>   transcript true;
>> }
>
> Thanks! Here's the fix:
>
> diff --git a/mailbox/msrv.c b/mailbox/msrv.c
> index a318371..13a85d4 100644
> --- a/mailbox/msrv.c
> +++ b/mailbox/msrv.c
> @@ -970,7 +970,7 @@ server_section_parser (enum mu_cfg_section_stage stage,
>      {
>      case mu_cfg_section_start:
>        {
> - if (node->label->type != MU_CFG_STRING)
> + if (node->label == NULL || node->label->type != MU_CFG_STRING)
>    return 1;
>   /* FIXME: should not modify 2nd arg, or it should not be const */
>   return server_block_begin (tree->debug, node->label->v.string,

Thanks!

/Simon


_______________________________________________
Bug-mailutils mailing list
Bug-mailutils@...
http://lists.gnu.org/mailman/listinfo/bug-mailutils