[voikko-devel] Core dump in Malaga 7.6

Bjoern Beutel bjoern-beutel at arcor.de
Mon Sep 25 15:51:42 EEST 2006


Hi Hannu,

On Monday 25 September 2006 13:12, Hannu Väisänen wrote:
> Malaga version 7.6 dumps core if input to malaga is encoded in
> ISO-8859-15. Of course it should not work because Malaga uses UTF-8
> but is it possible to give an error message instead of a core dump?

I forgot to check the UTF-8 code for validity when adding libreadline
support. Can you try the following patch:

*** commands_interactive.c~	2006-09-01 22:55:03.000000000 +0200
--- commands_interactive.c	2006-09-25 14:41:46.000000000 +0200
***************
*** 90,93 ****
--- 90,95 ----
  #ifdef READLINE
        command_line = readline(p);
+       if (! g_utf8_validate( command_line, -1, NULL ))
+         complain( "Illegal UTF-8 character." );
  #else
        printf( "%s> ", prompt );

I also forgot to validate the command line argument for "-input", which 
should be corrected by the following patch:

*** malaga.c~	2006-07-29 07:25:39.000000000 +0200
--- malaga.c	2006-09-25 14:43:39.000000000 +0200
***************
*** 1097,1100 ****
--- 1097,1102 ----
  	complain( "Redundant \"-input\"." );
        input = argv[i];
+       if (! g_utf8_validate( input, -1, NULL ))
+ 	complain( "Illegal UTF-8 character." );
      }
      else if (strcmp_no_case( argv[i], "-quoted" ) == 0

Can you give them a try?

Björn



More information about the devel mailing list