-
Notifications
You must be signed in to change notification settings - Fork 187
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
Long run of periods causes detect() to throw NegativeArraySizeException "Backtracked max amount of characters. Endless loop detected." #15
Comments
davidthemarsh
changed the title
Long run of periods causes detect() to throws NegativeArraySizeException "Backtracked max amount of characters. Endless loop detected."
Long run of periods causes detect() to throw NegativeArraySizeException "Backtracked max amount of characters. Endless loop detected."
Feb 21, 2017
I am also having the same issue...here is my test code
Below is the stack trace..
|
pgalbraith
added a commit
to pgalbraith/URL-Detector
that referenced
this issue
Sep 23, 2018
So the obvious downside is the risk of actually getting into an endless loop but I think the risk is worth it. If the code is solid then this is not possible, so I'd rather address those cases as (if?) they come up, instead causing false failures like the case in this issue.
pgalbraith
added a commit
to pgalbraith/URL-Detector
that referenced
this issue
Sep 23, 2018
So the obvious downside is the risk of actually getting into an endless loop but I think the risk is worth it. If the code is solid then this is not possible, so I'd rather address those cases as (if?) they come up, instead causing false failures like the case in this issue.
cstroe
pushed a commit
to cosmincloud/URL-Detector
that referenced
this issue
Dec 1, 2018
So the obvious downside is the risk of actually getting into an endless loop but I think the risk is worth it. If the code is solid then this is not possible, so I'd rather address those cases as (if?) they come up, instead causing false failures like the case in this issue.
cstroe
pushed a commit
to cosmincloud/URL-Detector
that referenced
this issue
Dec 1, 2018
So the obvious downside is the risk of actually getting into an endless loop but I think the risk is worth it. If the code is solid then this is not possible, so I'd rather address those cases as (if?) they come up, instead causing false failures like the case in this issue.
cstroe
pushed a commit
to cosmincloud/URL-Detector
that referenced
this issue
Dec 1, 2018
Remove endless loop detection to address linkedin#15. See merge request coscloud/URL-Detector!5
Beware, yet another case, which leads to endless loop:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
String text = ".............:::::::::::;;;;;;;;;;;;;;;::...............................................:::::::::::::::::::::::::::::...................."; UrlDetector d = new UrlDetector(text, UrlDetectorOptions.Default); d.detect();
Running this will throw
Exception in thread "main" java.lang.NegativeArraySizeException: Backtracked max amount of characters. Endless loop detected. Bad Text: ':...............................................:::::::::::::::::::::::::::::....................' at com.linkedin.urls.detection.InputTextReader.checkBacktrackLoop(InputTextReader.java:144) at com.linkedin.urls.detection.InputTextReader.seek(InputTextReader.java:120) at com.linkedin.urls.detection.UrlDetector.readUserPass(UrlDetector.java:511) at com.linkedin.urls.detection.UrlDetector.readScheme(UrlDetector.java:458) at com.linkedin.urls.detection.UrlDetector.processColon(UrlDetector.java:293) at com.linkedin.urls.detection.UrlDetector.readDefault(UrlDetector.java:253) at com.linkedin.urls.detection.UrlDetector.detect(UrlDetector.java:142) at Main.main(Main.java:82) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
The text was updated successfully, but these errors were encountered: