From db86c203b75aa4863021aaa2a409f90ee97fb934 Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 28 Nov 2013 07:53:47 +0000 Subject: more null-checking. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3309 ee746299-78ed-0310-b773-934348b2243d --- ChangeLog | 9 +++++++++ src/syldap.c | 4 ++-- src/vcard.c | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 91694572..ea82dbd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2013-11-28 + + * src/syldap.c: + syldap_test_connect(): + syldap_read_basedn(): + NULL check argument first. + * src/vcard.c: vcard_build_items(): dereference nodeRemarks only if + it's non-null. + 2013-11-28 * src/rpop3.c: rpop3_retr_recv(): check error of diff --git a/src/syldap.c b/src/syldap.c index dd46b5ca..6c609ad0 100644 --- a/src/syldap.c +++ b/src/syldap.c @@ -891,8 +891,8 @@ GList *syldap_read_basedn( SyldapServer *ldapServer ) { gchar **vals; struct timeval timeout; - ldapServer->retVal = MGU_BAD_ARGS; if( ldapServer == NULL ) return baseDN; + ldapServer->retVal = MGU_BAD_ARGS; if( ldapServer->hostName == NULL ) return baseDN; if( ldapServer->port < 1 ) return baseDN; @@ -1041,8 +1041,8 @@ gboolean syldap_test_connect( SyldapServer *ldapServer ) { gboolean retVal = FALSE; LDAP *ld; - ldapServer->retVal = MGU_BAD_ARGS; if( ldapServer == NULL ) return retVal; + ldapServer->retVal = MGU_BAD_ARGS; if( ldapServer->hostName == NULL ) return retVal; if( ldapServer->port < 1 ) return retVal; ldapServer->retVal = MGU_LDAP_INIT; diff --git a/src/vcard.c b/src/vcard.c index a078607b..dd7219a6 100644 --- a/src/vcard.c +++ b/src/vcard.c @@ -384,8 +384,8 @@ static void vcard_build_items( VCardFile *cardFile, GSList *listName, GSList *li if( *str != '\0' ) { ItemEMail *email = addritem_create_item_email(); addritem_email_set_address( email, str ); - str = nodeRemarks->data; if( nodeRemarks ) { + str = nodeRemarks->data; if( str ) { if( g_ascii_strcasecmp( str, "internet" ) != 0 ) { if( *str != '\0' ) addritem_email_set_remarks( email, str ); -- cgit v1.2.3