Falko Riemenschneider created PDFBOX-2907:
---------------------------------------------
Summary: Non-termination in PDResources.createKey()
Key: PDFBOX-2907
URL: https://issues.apache.org/jira/browse/PDFBOX-2907
Project: PDFBox
Issue Type: Bug
Components: PDModel
Affects Versions: 2.0.0
Reporter: Falko Riemenschneider
When trying to set a font using CSPageContentStream.setFont() a new key is
required which is created in PDResources.createKey(), ca line 450.
If the dict keySet contains "F1", "F2", "F4", "F5" then just trying to use
{code}
(dict.keySet().size() + 1)
{code}
will not find a new key und the loop won't terminate.
This here terminates:
{code}
String key;
int i = dict.keySet().size();
do
{
i++;
key = prefix + i;
}
while (dict.containsKey(key));
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]