Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dowload crash #61

Open
GoogleCodeExporter opened this issue Jan 20, 2016 · 0 comments
Open

Dowload crash #61

GoogleCodeExporter opened this issue Jan 20, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Click a url whose content contains no "?" to download something. 
2. The Browser crashes immediately.

What is the expected output? What do you see instead?
A StringIndexOutOfBoundsException from the logcat.


What version of the product are you using? On what operating system?
I build the source code by myself, but I think it's the latest version 0.4.4. I 
am running it on a Android 2.3 mobile phone. 

Please provide any additional information below.
Fixing the following code defect may fix this bug :
1)
DownloadItem.java line 68 :         
mFileName = mFileName.substring(0, mFileName.indexOf("?");

replaced with:
int end = mFileName.indexOf("?") >= 0 ? mFileName.indexOf("?") : 
mFileName.length();
mFileName = mFileName.substring(0, end);

2)
DownloadRunnable.java line 68
return fileName.substring(0, fileName.indexOf("?");

replaced with :
int end = fileName.indexOf("?") >= 0 ? fileName.indexOf("?") : 
fileName.length();
        return fileName.substring(0, end);






Original issue reported on code.google.com by [email protected] on 24 May 2012 at 3:49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant