Merge lp:~ivaldi/midori/fix-1208995 into lp:midori

Proposed by André Stösel
Status: Merged
Approved by: Paweł Forysiuk
Approved revision: 6323
Merged at revision: 6324
Proposed branch: lp:~ivaldi/midori/fix-1208995
Merge into: lp:midori
Diff against target: 20 lines (+6/-4)
1 file modified
katze/midori-uri.vala (+6/-4)
To merge this branch: bzr merge lp:~ivaldi/midori/fix-1208995
Reviewer Review Type Date Requested Status
gue5t gue5t Approve
Review via email: mp+178858@code.launchpad.net

Commit message

Fix segfault if url contains " %00"

To post a comment you must log in.
Revision history for this message
gue5t gue5t (gue5t) wrote :

This fixes the crash but causes urls like "http://www.google.com/%21%00ok" to not decode any characters, whereas the url "http://www.google.com/%21ok" gets normalized to "http://www.google.com/!ok" for display. Presumably we should ensure that 0x00 characters are not urldecoded while still decoding the others.

We also shouldn't ever decode %25 (encoded '%'), because doing so can cause hitting enter in the url bar to change the actual url, e.g. a page which is locally on disk as "get%100.html" would be urlencoded as "get%25100.html" but would request "get%100.html" when the user hits enter in the urlbar after visiting the page.

review: Needs Fixing
Revision history for this message
André Stösel (ivaldi) wrote :

I agree, we should review the url en/decoding.
However, this isn't related with the segfault -> I opened a new bug #1209167 for this.

Revision history for this message
gue5t gue5t (gue5t) wrote :

I agree, we can fix the handling later. This does fix the segfault, no regression, so r+.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'katze/midori-uri.vala'
2--- katze/midori-uri.vala 2012-11-07 00:21:15 +0000
3+++ katze/midori-uri.vala 2013-08-06 21:56:22 +0000
4@@ -84,10 +84,12 @@
5 else if (!unescaped.validate ())
6 return uri;
7 string path;
8- string hostname = parse_hostname (unescaped, out path);
9- string decoded = hostname_to_unicode (hostname);
10- if (decoded != null)
11- return "http://" + decoded + path;
12+ string? hostname = parse_hostname (unescaped, out path);
13+ if (hostname != null) {
14+ string decoded = hostname_to_unicode (hostname);
15+ if (decoded != null)
16+ return "http://" + decoded + path;
17+ }
18 return unescaped;
19 }
20 return uri;

Subscribers

People subscribed via source and target branches

to all changes: