axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maria Indeeva (JIRA)" <j...@apache.org>
Subject [jira] Created: (AXIS2C-1492) maximum value of xsd:unsignedInt cannot exceed maximum value of signed integer (2147483647)
Date Mon, 23 Aug 2010 23:58:19 GMT
maximum value of xsd:unsignedInt cannot exceed maximum value of signed integer (2147483647)
-------------------------------------------------------------------------------------------

                 Key: AXIS2C-1492
                 URL: https://issues.apache.org/jira/browse/AXIS2C-1492
             Project: Axis2-C
          Issue Type: Bug
          Components: code generation
    Affects Versions: 1.6.0
            Reporter: Maria Indeeva


Deserialize functionality for xsd:unsignedInt values is done via atoi() function. Here is
an example of the generated code for unsignedInt element:
text_value = axiom_element_get_text(current_element, env, current_node); 
if(text_value != NULL)
{
          status = adb_clientClass_set_priority(_clientClass, env,
                           atoi(text_value));
}

Here is how that element is defined in XSD file:
<xsd:element name="priority" type="xsd:unsignedInt">
            ...
</xsd:element

Unfortunately atoi is returning int (signed integer) and as a result whenever the value for
that unsignedInt element is set to be large than the maximum value for SIGNED integer (larger
than 2147483647) it is decreased to 2147483647, while the maximum value for unsignedInt should
be 4294967295.
Once the atoi() in generated code is replaced with strtoul() the problem is gone.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: c-dev-help@axis.apache.org


Mime
View raw message