[evolution-activesync] connection: avoid NULL pointer passing/access
- From: Patrick Ohly <pohly src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-activesync] connection: avoid NULL pointer passing/access
- Date: Fri, 31 Aug 2012 19:36:27 +0000 (UTC)
commit c2948cf1393dc41923c8bb03d5a0ba546ef6d6d1
Author: Patrick Ohly <patrick ohly intel com>
Date: Fri Aug 31 19:27:53 2012 +0000
connection: avoid NULL pointer passing/access
valgrind complained about NULL being passed to fwrite(). Probably
happend in combination with an actual non-zero length parameter
because of some network error - better check data pointer.
eas-daemon/libeas/eas-connection.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/eas-daemon/libeas/eas-connection.c b/eas-daemon/libeas/eas-connection.c
index 9393bd7..52d58fe 100644
--- a/eas-daemon/libeas/eas-connection.c
+++ b/eas-daemon/libeas/eas-connection.c
@@ -2265,7 +2265,8 @@ write_response_to_file (const WB_UTINY* xml, WB_ULONG xml_len)
fullPath = g_strconcat (path, filename, NULL);
if ( (file = fopen (fullPath, "w"))) {
- fwrite (xml, 1, xml_len, file);
+ if (xml)
+ fwrite (xml, 1, xml_len, file);
fclose (file);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]