[gnome-software] trivial: Fix a potential crash when sending data from snapd
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Fix a potential crash when sending data from snapd
- Date: Mon, 18 Jul 2016 10:00:12 +0000 (UTC)
commit b691ea593b9c418db3f8d752964b997bab1a3a1e
Author: Richard Hughes <richard hughsie com>
Date: Mon Jul 18 10:10:52 2016 +0100
trivial: Fix a potential crash when sending data from snapd
Found with clang...
src/plugins/gs-snapd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/gs-snapd.c b/src/plugins/gs-snapd.c
index 1a36d8d..c591a6e 100644
--- a/src/plugins/gs-snapd.c
+++ b/src/plugins/gs-snapd.c
@@ -287,7 +287,7 @@ gs_snapd_request (const gchar *method,
if (response_type)
*response_type = g_strdup (soup_message_headers_get_content_type (headers, NULL));
- if (response) {
+ if (response != NULL && chunk_start != NULL) {
*response = g_malloc (chunk_length + 2);
memcpy (*response, chunk_start, chunk_length + 1);
(*response)[chunk_length + 1] = '\0';
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]