From f9e3d85bf6914de465262926fc0e32b1ddeef692 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 8 Dec 2014 17:41:38 -0500 Subject: [PATCH] Fix coverity issue about unchecked return If find_path() does not find MinorVersion, then no value is changed and we repeate the search with the values for thr major version. Check if we have found anything and if not set the minor version to 0. License: MIT Signed-off-by: Simo Sorce --- lasso/xml/xml.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index 436dcc19..d6e29eda 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -1955,10 +1955,13 @@ lasso_node_impl_get_xmlNode(LassoNode *node, gboolean lasso_dump) version_snippet); major_version = *value; - find_path(node, "MinorVersion", &value_node, &version_class, &version_snippet); - value = SNIPPET_STRUCT_MEMBER_P(value_node, G_TYPE_FROM_CLASS(version_class), - version_snippet); - minor_version = *value; + if (find_path(node, "MinorVersion", &value_node, &version_class, &version_snippet) == TRUE) { + value = SNIPPET_STRUCT_MEMBER_P(value_node, G_TYPE_FROM_CLASS(version_class), + version_snippet); + minor_version = *value; + } else { + minor_version = 0; + } if (strcmp((char*)xmlnode->ns->href, LASSO_LIB_HREF) == 0) { if (major_version == 1 && minor_version == 0) {