From c-dev-return-23520-apmail-axis-c-dev-archive=axis.apache.org@axis.apache.org Tue Apr 7 16:42:04 2020 Return-Path: X-Original-To: apmail-axis-c-dev-archive@www.apache.org Delivered-To: apmail-axis-c-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id 1E6CF1947A for ; Tue, 7 Apr 2020 16:42:04 +0000 (UTC) Received: (qmail 84959 invoked by uid 500); 7 Apr 2020 16:42:03 -0000 Delivered-To: apmail-axis-c-dev-archive@axis.apache.org Received: (qmail 84882 invoked by uid 500); 7 Apr 2020 16:42:03 -0000 Mailing-List: contact c-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache AXIS C Developers List" Delivered-To: mailing list c-dev@axis.apache.org Received: (qmail 84821 invoked by uid 99); 7 Apr 2020 16:42:03 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Apr 2020 16:42:03 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 6F971E29C3 for ; Tue, 7 Apr 2020 16:42:02 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 90A8D7823CE for ; Tue, 7 Apr 2020 16:42:00 +0000 (UTC) Date: Tue, 7 Apr 2020 16:42:00 +0000 (UTC) From: "Bill Blough (Jira)" To: c-dev@axis.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AXIS2C-1528) axiom_util_get_first_child_element_with_localname() returns wrong child_node if a sibling is present and the first node does not match MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AXIS2C-1528?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bill Blough updated AXIS2C-1528: -------------------------------- Fix Version/s: (was: Next Version) 1.7.0 > axiom_util_get_first_child_element_with_localname() returns wrong child_node if a sibling is present and the first node does not match > -------------------------------------------------------------------------------------------------------------------------------------- > > Key: AXIS2C-1528 > URL: https://issues.apache.org/jira/browse/AXIS2C-1528 > Project: Axis2-C > Issue Type: Bug > Components: util > Affects Versions: 1.6.0 > Environment: Linux > Reporter: Aleksey Mokhonko > Assignee: Korale Gamaralalage Nandika Chandrasiri Jayawardana > Priority: Major > Fix For: 1.7.0 > > > Bug is obvious. I just show what to fix. > File: om_util.c > Routine: axiom_util_get_first_child_element_with_localname_attr() > Line: 830 > Present: > if (om_attr_name && NULL != om_attr_value && > axutil_strcmp(om_attr_name, attr_name) == 0 > && axutil_strcmp(om_attr_value, > attr_value) == 0) > { > *child_node = child; /* <-------------------------------- !!!!!!!!!!!!!!!! */ > return om_ele; > } > Must be: > if (om_attr_name && NULL != om_attr_value && > axutil_strcmp(om_attr_name, attr_name) == 0 > && axutil_strcmp(om_attr_value, > attr_value) == 0) > { > *child_node = next_sibling; /* <-------------------------------- !!!!!!!!!!!!!!!! */ > return om_ele; > } > =============================================== > More detailed: > =============================================== > next_sibling = axiom_node_get_next_sibling(child, env); > while (next_sibling) > { > if (axiom_node_get_node_type(next_sibling, env) == AXIOM_ELEMENT) > { > om_ele = > (axiom_element_t *) axiom_node_get_data_element(next_sibling, > env); > if (om_ele) > { > child_localname = axiom_element_get_localname(om_ele, env); > if (child_localname && > axutil_strcmp(child_localname, localname) == 0) > { > attr_ht = axiom_element_get_all_attributes(om_ele, env); > if (attr_ht) > { > for (hi = axutil_hash_first(attr_ht, env); hi; > hi = axutil_hash_next(env, hi)) > { > void *val = NULL; > axutil_hash_this(hi, NULL, NULL, &val); > if (val) > { > om_attr = (axiom_attribute_t *) val; > om_attr_name = > axiom_attribute_get_localname(om_attr, env); > om_attr_value = > axiom_attribute_get_value(om_attr, env); > if (om_attr_name && NULL != om_attr_value && > axutil_strcmp(om_attr_name, attr_name) == 0 > && axutil_strcmp(om_attr_value, > attr_value) == 0) > { > *child_node = next_sibling; /* !!!!!!!!!!!!!!!! */ <----------------------------------------- !!!!!!!!!!!!!!!!!!!!!!!!! > return om_ele; > } > om_attr = NULL; > om_attr_name = NULL; > om_attr_value = NULL; > } > } > } > } > > } > om_ele = NULL; > child_localname = NULL; > } > next_sibling = axiom_node_get_next_sibling(next_sibling, env); > } > return NULL; > } -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org For additional commands, e-mail: c-dev-help@axis.apache.org