[evolution-ews/gnome-3-16] ews_dump_raw_soup_message: Check for non-NULL hdrs and body arguments



commit da6975427508fef3bea13678abcc02eb4234e178
Author: Milan Crha <mcrha redhat com>
Date:   Tue Jun 30 12:31:47 2015 +0200

    ews_dump_raw_soup_message: Check for non-NULL hdrs and body arguments

 src/server/e-ews-connection.c |    9 ++++++---
 src/server/e-ews-debug.c      |    3 ++-
 2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/server/e-ews-connection.c b/src/server/e-ews-connection.c
index dd4e1e2..65cfb15 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -2476,7 +2476,7 @@ static void
 ews_dump_raw_soup_message (FILE *out, SoupMessageHeaders *hdrs,
                           SoupMessageBody *body)
 {
-       if (soup_message_body_get_accumulate (body)) {
+       if (body && soup_message_body_get_accumulate (body)) {
                SoupBuffer *buffer;
 
                buffer = soup_message_body_flatten (body);
@@ -2485,9 +2485,12 @@ ews_dump_raw_soup_message (FILE *out, SoupMessageHeaders *hdrs,
 
        /* print body */
        fprintf (out, " =====================\n");
-       soup_message_headers_foreach (hdrs, print_header, out);
+       if (hdrs)
+               soup_message_headers_foreach (hdrs, print_header, out);
+       else
+               fprintf (out, " null headers\n");
        fputc ('\n', out);
-       if (body->data) {
+       if (body && body->data) {
                fputs (body->data, out);
                fputc ('\n', out);
        }
diff --git a/src/server/e-ews-debug.c b/src/server/e-ews-debug.c
index 769ca07..d408fc0 100644
--- a/src/server/e-ews-debug.c
+++ b/src/server/e-ews-debug.c
@@ -65,7 +65,8 @@ e_ews_connection_get_server_version_string (EEwsConnection *cnc)
 }
 
 EEwsServerVersion
-e_ews_debug_get_server_version_from_string (const gchar *version) {
+e_ews_debug_get_server_version_from_string (const gchar *version)
+{
        if (g_strcmp0 (version, "Exchange2007") == 0)
                return E_EWS_EXCHANGE_2007;
        else if (g_strcmp0 (version, "Exchange2007_SP1") == 0)


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