[gnome-builder] clang: check for NULL gvariant parameters
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] clang: check for NULL gvariant parameters
- Date: Sat, 16 Jun 2018 10:58:45 +0000 (UTC)
commit 95a2302b8dd43ea55279b7e41f94db3620c58ff6
Author: Christian Hergert <chergert redhat com>
Date: Sat Jun 16 03:56:52 2018 -0700
clang: check for NULL gvariant parameters
src/plugins/clang/ide-clang-client.c | 2 +-
src/plugins/clang/ide-clang-code-index-entries.c | 1 +
src/plugins/clang/ide-clang-proposals.c | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/clang/ide-clang-client.c b/src/plugins/clang/ide-clang-client.c
index 80f59983a..9e5f72857 100644
--- a/src/plugins/clang/ide-clang-client.c
+++ b/src/plugins/clang/ide-clang-client.c
@@ -548,7 +548,7 @@ ide_clang_client_call_async (IdeClangClient *self,
call = g_slice_new0 (Call);
call->self = g_object_ref (self);
call->method = g_strdup (method);
- call->params = g_variant_ref_sink (params);
+ call->params = params ? g_variant_ref_sink (params) : NULL;
task = ide_task_new (self, cancellable, callback, user_data);
ide_task_set_source_tag (task, ide_clang_client_call_async);
diff --git a/src/plugins/clang/ide-clang-code-index-entries.c
b/src/plugins/clang/ide-clang-code-index-entries.c
index 3362e3b3e..ff5cc6162 100644
--- a/src/plugins/clang/ide-clang-code-index-entries.c
+++ b/src/plugins/clang/ide-clang-code-index-entries.c
@@ -138,6 +138,7 @@ ide_clang_code_index_entries_next_entries_async (IdeCodeIndexEntries *entries,
g_autoptr(IdeTask) task = NULL;
g_assert (IDE_IS_CLANG_CODE_INDEX_ENTRIES (self));
+ g_assert (self->entries != NULL);
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
task = ide_task_new (self, cancellable, callback, user_data);
diff --git a/src/plugins/clang/ide-clang-proposals.c b/src/plugins/clang/ide-clang-proposals.c
index 498c1f2bc..236b74c93 100644
--- a/src/plugins/clang/ide-clang-proposals.c
+++ b/src/plugins/clang/ide-clang-proposals.c
@@ -424,7 +424,7 @@ ide_clang_proposals_flush (IdeClangProposals *self,
if (results != self->results)
{
g_clear_pointer (&self->results, g_variant_unref);
- self->results = g_variant_ref (results);
+ self->results = results ? g_variant_ref (results) : NULL;
}
ide_clang_proposals_do_refilter (self, FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]