RESOLVED FIXED Bug 57209
Assigning location.path to something that doesn't start with / mangles the authority
https://bugs.webkit.org/show_bug.cgi?id=57209
Summary Assigning location.path to something that doesn't start with / mangles the au...
Maciej Stachowiak
Reported 2011-03-28 00:25:25 PDT
Assigning location.path to something that doesn't start with / mangles the authority
Attachments
Patch (5.60 KB, patch)
2011-03-28 00:26 PDT, Maciej Stachowiak
mitz: review+
Maciej Stachowiak
Comment 1 2011-03-28 00:26:31 PDT
Adam Barth
Comment 2 2011-03-28 01:00:45 PDT
Comment on attachment 87108 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=87108&action=review > Source/WebCore/platform/KURL.cpp:864 > + if (path.length() < 1 || path[0] != '/') > + path = "/" + path; I'd just test for path.isEmpty() instead of path.length() < 1.
Maciej Stachowiak
Comment 3 2011-03-28 02:34:30 PDT
Darin Adler
Comment 4 2011-03-28 08:51:04 PDT
Comment on attachment 87108 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=87108&action=review >> Source/WebCore/platform/KURL.cpp:864 >> + path = "/" + path; > > I'd just test for path.isEmpty() instead of path.length() < 1. Since string subscripting does a length check, there is no need to check path.length() or path.isEmpty(). The value path[0] will be 0 if the path is empty.
Note You need to log in before you can comment on or make changes to this bug.