Re: Patch for a crash in POP when TLS errors happen



Approved, nice catch


On Tue, 2008-06-03 at 18:33 +0200, Sergio Villar Senin wrote:
> Hi,
> 
> this patch fixes a crash when trying to connect to a POP3 server, which
> for example requires SSL, and only TLS was specified.
> 
> The problem is the following:
> 1- connect_to_server of camel-pop3-store.c fails and then it goes to
> stls_exception.
> 2- then that code executes
> 
> 		/* try to disconnect cleanly */
> 		pc = camel_pop3_engine_command_new (store->engine, 0, NULL, NULL,
> "QUIT\r\n");
> 		while (camel_pop3_engine_iterate (store->engine, NULL) > 0)
> 			;
> 		camel_pop3_engine_command_free (store->engine, pc);
> 
> 3- the problem is that this camel_pop3_engine_iterate can (and it indeed
> does) issue a camel_service_disconnect which for pop calls
> pop3_disconnect_online, that in line 178 does store->engine = NULL
> 
> 4- so the after the "innocent" call to camel_pop3_engine_iterate we'll
> get a NULL store->engine, amazing he? :-)
> 
> 5- you all know what happens when we later call
> camel_object_unref(store->engine) ;-)
> 
> Br
> _______________________________________________
> tinymail-devel-list mailing list
> tinymail-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/tinymail-devel-list
-- 
Philip Van Hoof, freelance software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://pvanhoof.be/blog
http://codeminded.be






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]