[libgsf] Compilation: work around clang warning.



commit 4ca214e72e53c739830401b14831606a9e870f86
Author: Morten Welinder <terra gnome org>
Date:   Mon Jan 7 14:34:56 2013 -0500

    Compilation: work around clang warning.

 ChangeLog              |    3 +++
 gsf/gsf-input-memory.c |    3 ++-
 2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 15cf4f7..23c4a1f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2013-01-07  Morten Welinder  <terra gnome org>
 
+	* gsf/gsf-input-memory.c (gsf_input_memory_new_clone): For around
+	a clang false positive.
+
 	* gsf/*.c: Stop pretending that g_object_new can return NULL.
 
 2013-01-05  Morten Welinder  <terra gnome org>
diff --git a/gsf/gsf-input-memory.c b/gsf/gsf-input-memory.c
index fdce203..7b71a72 100644
--- a/gsf/gsf-input-memory.c
+++ b/gsf/gsf-input-memory.c
@@ -90,7 +90,8 @@ gsf_input_memory_new_clone (guint8 const *buf, gsf_off_t length)
 		g_object_unref (mem);
 		return NULL;
 	}
-	memcpy (cpy, buf, length);
+	if (buf)
+		memcpy (cpy, buf, length);
 	mem->shared = gsf_shared_memory_new (cpy, length, TRUE);
 	gsf_input_set_size (GSF_INPUT (mem), length);
 	return GSF_INPUT (mem);



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