From 3bd2f17754009d84df1aeb60cfa1d3510182e87c Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Fri, 25 Nov 2011 12:16:05 +0000 Subject: msn_soap_debug_print may get called with NULL pointers. Pay attention. --- protocols/msn/soap.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'protocols') diff --git a/protocols/msn/soap.c b/protocols/msn/soap.c index cbc384be..467429fb 100644 --- a/protocols/msn/soap.c +++ b/protocols/msn/soap.c @@ -214,12 +214,16 @@ static void msn_soap_debug_print( const char *headers, const char *payload ) if( !getenv( "BITLBEE_DEBUG" ) ) return; - if( ( s = strstr( headers, "\r\n\r\n" ) ) ) - st = write( 1, headers, s - headers + 4 ); - else - st = write( 1, headers, strlen( headers ) ); + if( headers ) + { + if( ( s = strstr( headers, "\r\n\r\n" ) ) ) + st = write( 1, headers, s - headers + 4 ); + else + st = write( 1, headers, strlen( headers ) ); + } #ifdef DEBUG + if( payload ) { struct xt_node *xt = xt_from_string( payload ); if( xt ) -- cgit v1.2.3