[ 
http://issues.apache.org/jira/browse/XALANC-583?page=comments#action_12357450 ] 

David Bertoni commented on XALANC-583:
--------------------------------------

Thanks for the details.  We will certainly fix the bug, but I was just curious 
how you were getting to that code, since it's normally only needed for the old 
HP library.  You should definitely use -DXALAN_HAS_STD_DISTANCE, since that's 
the most tested code path.

That's an interesting implementation of the old version of distance().  The HP 
implementation is something like:

n = last - first;

which is semantically different from the STLport version.  I guess we'll really 
never know, since this version was never part of the standard.

Thanks for the report.

> XalanVector.hpp is missing initialiation of local variable
> ----------------------------------------------------------
>
>          Key: XALANC-583
>          URL: http://issues.apache.org/jira/browse/XALANC-583
>      Project: XalanC
>         Type: Bug
>   Components: XalanC
>     Versions: 1.10
>  Environment: N/A
>     Reporter: Soren Soe

>
> The member function 'local_distance'  declares 'size_type theDistance' but 
> does not initialize the variable.  The variable is passed to 
> std::distance(itr,itr,distance), where its value is referenced and used in a 
> '+=' expression.   Failing to initialize 'theDistance' causes 
> 'local_distance' to have undefined behavior, ultimately leading to a crash at 
> runtime.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to