After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 747362 - Make sure g_daemon_file_query_writable_namespaces() never return NULL
Make sure g_daemon_file_query_writable_namespaces() never return NULL
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2015-04-05 09:38 UTC by Christophe Fergeau
Modified: 2015-04-10 08:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Rework code flow in g_daemon_file_query_writable_namespaces() (2.13 KB, patch)
2015-04-05 09:38 UTC, Christophe Fergeau
reviewed Details | Review
Don't return NULL from g_daemon_file_query_writable_namespaces() (1.11 KB, patch)
2015-04-05 09:38 UTC, Christophe Fergeau
reviewed Details | Review
Rework code flow in g_daemon_file_query_writable_namespaces() (2.13 KB, patch)
2015-04-07 08:30 UTC, Christophe Fergeau
accepted-commit_now Details | Review
Don't return NULL from g_daemon_file_query_writable_namespaces() (1.11 KB, patch)
2015-04-07 08:30 UTC, Christophe Fergeau
accepted-commit_now Details | Review

Description Christophe Fergeau 2015-04-05 09:38:20 UTC
This was the intent of b358ca but there is still one case when NULL is returned.
Comment 1 Christophe Fergeau 2015-04-05 09:38:25 UTC
Created attachment 300977 [details] [review]
Rework code flow in g_daemon_file_query_writable_namespaces()

This makes the common (non-error) case more linear, and thus a bit more
readable. This is in preparation for the next commits.
Comment 2 Christophe Fergeau 2015-04-05 09:38:36 UTC
Created attachment 300978 [details] [review]
Don't return NULL from g_daemon_file_query_writable_namespaces()

Since commit b358ca "Make sure metadata is always returned by
query_writable_namespaces()", query_writable_namespaces() is expected to
return non-NULL values. There is one error case where it's not currently
doing that.
Comment 3 Ross Lagerwall 2015-04-05 15:52:37 UTC
Review of attachment 300977 [details] [review]:

Otherwise OK.

::: client/gdaemonfile.c
@@ +2609,2 @@
       list = g_file_attribute_info_list_new ();
+      goto end;

I'd prefer if this was "out" to be consistent with the rest of the code.
Comment 4 Ross Lagerwall 2015-04-05 15:52:42 UTC
Review of attachment 300978 [details] [review]:

Otherwise OK.

::: client/gdaemonfile.c
@@ +2595,3 @@
+    {
+      list = g_file_attribute_info_list_new ();
+      goto end;

I'd prefer if this was "out" to be consistent with the rest of the code.
Comment 5 Christophe Fergeau 2015-04-07 08:30:43 UTC
Created attachment 301047 [details] [review]
Rework code flow in g_daemon_file_query_writable_namespaces()

This makes the common (non-error) case more linear, and thus a bit more
readable. This is in preparation for the next commits.
Comment 6 Christophe Fergeau 2015-04-07 08:30:49 UTC
Created attachment 301048 [details] [review]
Don't return NULL from g_daemon_file_query_writable_namespaces()

Since commit b358ca "Make sure metadata is always returned by
query_writable_namespaces()", query_writable_namespaces() is expected to
return non-NULL values. There is one error case where it's not currently
doing that.
Comment 7 Ross Lagerwall 2015-04-09 20:57:09 UTC
Review of attachment 301047 [details] [review]:

Looks good.
Comment 8 Ross Lagerwall 2015-04-09 20:57:23 UTC
Review of attachment 301048 [details] [review]:

Looks good.
Comment 9 Christophe Fergeau 2015-04-10 08:33:42 UTC
Attachment 301047 [details] pushed as 090543f - Rework code flow in g_daemon_file_query_writable_namespaces()
Attachment 301048 [details] pushed as faa2b07 - Don't return NULL from g_daemon_file_query_writable_namespaces()