You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Pascal Schumacher (JIRA)" <ji...@apache.org> on 2016/11/18 15:53:59 UTC
[jira] [Resolved] (LANG-1287) RandomStringUtils#random can enter
infinite loop if end parameter is to small
[ https://issues.apache.org/jira/browse/LANG-1287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pascal Schumacher resolved LANG-1287.
-------------------------------------
Resolution: Fixed
Fix Version/s: 3.6
> RandomStringUtils#random can enter infinite loop if end parameter is to small
> -----------------------------------------------------------------------------
>
> Key: LANG-1287
> URL: https://issues.apache.org/jira/browse/LANG-1287
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.*
> Affects Versions: 3.5
> Reporter: Pascal Schumacher
> Assignee: Pascal Schumacher
> Fix For: 3.6
>
>
> {quote}I faced that the random method can cause an infinite loop. It can be caused if the end parameter is too low for generating either numbers (< 48) or letters (<65). I added some exception tests to make the cases clear. Basically, if we call the random function with for example numbers = true && end < 48 the validation for Character.isDigit(ch) will fail and we increment count count++.{quote}
> Ivan Morozov https://github.com/apache/commons-lang/pull/211
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)