Re: another ecpg crash - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: another ecpg crash
Date
Msg-id 20080511045251.GD9136@alvh.no-ip.org
Whole thread Raw
In response to another ecpg crash  (Euler Taveira de Oliveira <euler@timbira.com>)
Responses Re: another ecpg crash  (Euler Taveira de Oliveira <euler@timbira.com>)
List pgsql-hackers
Euler Taveira de Oliveira wrote:
> Hi,
>
> I found another bug when using 'exec sql include filename'. If you use a  
> filename that doesn't exist, ecpg crashes while trying to close a null  
> pointer. The above test case shows it. A possible fix is attached.

Huh, isn't the test backwards?

> --- 90,98 ----
>               ret_value = error_code;
>               break;
>           case ET_FATAL:
> !             /* there are some cases (i.e. file not found) that the input is not available */
> !             if (!yyin)
> !                 fclose(yyin);
>               fclose(yyout);
>               if (unlink(output_filename) != 0 && *output_filename != '-')
>                       fprintf(stderr, _("could not remove output file \"%s\"\n"), output_filename);



-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Euler Taveira de Oliveira
Date:
Subject: another ecpg crash
Next
From: Euler Taveira de Oliveira
Date:
Subject: Re: another ecpg crash