[Top][All Lists]

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

[Pan-devel] [PATCH] fix segfault on nntp server connect failure

From: Cal Peake
Subject: [Pan-devel] [PATCH] fix segfault on nntp server connect failure
Date: Fri, 1 Feb 2013 10:59:17 -0500 (EST)
User-agent: Alpine 2.00 (LNX 1167 2008-08-23)


Attached (and below) is a cut-n-paste job from 
pan/tasks/ to pan/tasks/ that 
fixes a segfault that occurs if we're unable to establish a connection to 
a configured news server.

Technical details: A failure to connect in the function create_channel() 
leaves a GIOChannel pointer uninitialized that then gets passed to 

Kind regards,

Cal Peake

diff --git a/pan/tasks/ b/pan/tasks/
index b11e926..afeb1a3 100644
--- a/pan/tasks/
+++ b/pan/tasks/
@@ -286,11 +286,14 @@ GIOChannelSocket :: open (const StringView& address, int 
port, std::string& setm
   _host.assign (address.str, address.len);
   _channel = create_channel (address, port, setme_err);
+  if (_channel)
+  {
 #ifdef G_OS_WIN32
   _id = g_io_channel_win32_get_fd(_channel);
    _id = g_io_channel_unix_get_fd(_channel);
 #endif // G_OS_WIN32
+  }
   return _channel != 0;

Attachment: fix-gio-socket-segfault.diff
Description: patch

reply via email to

[Prev in Thread] Current Thread [Next in Thread]