GNOME Bugzilla – Bug 788757
covscan warnings
Last modified: 2017-10-16 11:25:53 UTC
grilo-plugins-0.3.4/src/lua-factory/lua-library/lua-xml.c:88: assigned_pointer: Assigning value from "is_root_node ? node : node->children" to "node" here, but that stored value is overwritten before it can be used. grilo-plugins-0.3.4/src/lua-factory/grl-lua-library-operations.c:899:33: warning: Access to field 'source' results in a dereference of a null pointer (loaded from variable 'os') grilo-plugins-0.3.4/src/lua-factory/grl-lua-library-operations.c:853:33: warning: Access to field 'source' results in a dereference of a null pointer (loaded from variable 'os') grilo-plugins-0.3.4/src/lua-factory/grl-lua-library-operations.c:850:3: warning: Dereference of null pointer (loaded from variable 'err')
Created attachment 361219 [details] [review] lua-factory: Replace assertions with g_return_* macros Assertions might be disabled, and really shouldn't be used from within a library, but this should protect us enough for debugging purposes.
Created attachment 361220 [details] [review] lua-factory: Remove unused variable in XML parser The variable assignment wasn't used, and "node" was already assigned to either the root node, or one of its children earlier in the function. Caught by covscan: grilo-plugins-0.3.4/src/lua-factory/lua-library/lua-xml.c:88: assigned_pointer: Assigning value from "is_root_node ? node : node->children" to "node" here, but that stored value is overwritten before it can be used.
Review of attachment 361219 [details] [review]: These asserts are calls inside the library and shouldn't be triggered by applications, normally. As you said, we can disable the assert. Moving to warning and set fatal-warnings in G_DEBUG should still be doable if necessary.
Review of attachment 361220 [details] [review]: Sure
Attachment 361219 [details] pushed as a7eb4b9 - lua-factory: Replace assertions with g_return_* macros Attachment 361220 [details] pushed as 8c5969e - lua-factory: Remove unused variable in XML parser