Code review comment for lp:~zorba-coders/zorba/structuralrelationships2

Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

> Hi Markos,
> i noticed that the parse uri function now uses strtoul without checking errno
> with the following effects:
>
> A missing component is considered 0:
> np:in-same-tree-of(xs:anyURI("zorba:..1.50"),xs:anyURI("zorba:0.0.1.50"))
> ->true
>
>
> Out of ulong value-space == ULONG_MAX
> np:in-same-tree-of(xs:anyURI("zorba:.33333333333333333333333333333333333333333
> 33333333333333333333333333333333333333333333333333333333333333333333.1.50"),xs
> :anyURI("zorba:0.2222222222222222222222222222222222222222222222222222222222222
> 22222222222222222222222222222222222222222222.1.50")) ->true
>
> Is this ok?
>
> Thanks
> Federico

No, it not ok of course. It's a bug (and a similar bug existed before the switch to strtoul as well). I think I have fixed it now (and added the above 2 tests in position_err.xq). Take a look.

« Back to merge proposal