[Webkit-unassigned] [Bug 41913] New: XPath substring function has inconsistent handling of negative values for the position argument

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 8 15:36:20 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=41913

           Summary: XPath substring function has inconsistent handling of
                    negative values for the position argument
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore Misc.
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: steveblock at google.com


In the XPath substring function, if a negative value is supplied for the position argument and a length argument is present, we reset the position argument to the first character of the string and adjust the length argument such that the final character in the substring is the same as it would have been if the length were counted from the original negative position value. We then return the substring using the new position and length.

However, in the case where no length argument is present, we call String::substring() with the negative position value. Since String::substring() takes two unsigned int arguments, the position value gets wrapped to a large integer and we likely return the empty string because the wrapped position value exceeds the string length. This seems incorrect and is inconsistent with the above case.

See Bug 41862 for some background.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list