mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 09:49:23 +02:00
gp-4641 - MDMang fix infinite loop
This commit is contained in:
parent
b5e6782db6
commit
2efe1b9e62
1 changed files with 9 additions and 2 deletions
|
@ -4,9 +4,9 @@
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -97,9 +97,16 @@ public class MDQualification extends MDParsableItem implements Iterable<MDQualif
|
||||||
@Override
|
@Override
|
||||||
protected void parseInternal() throws MDException {
|
protected void parseInternal() throws MDException {
|
||||||
while ((dmang.peek() != MDMang.DONE) && (dmang.peek() != '@')) {
|
while ((dmang.peek() != MDMang.DONE) && (dmang.peek() != '@')) {
|
||||||
|
int loc = dmang.getIndex();
|
||||||
MDQualifier qual = new MDQualifier(dmang);
|
MDQualifier qual = new MDQualifier(dmang);
|
||||||
qual.parse();
|
qual.parse();
|
||||||
quals.add(qual);
|
quals.add(qual);
|
||||||
|
// This is a quick fix to prevent infinite looping when the next character is not
|
||||||
|
// expected. TODO: need to work on code the breaks symbols on these other
|
||||||
|
// characters that we have seen such as '.' and '`'.
|
||||||
|
if (dmang.getIndex() == loc) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (dmang.peek() == '@') {
|
if (dmang.peek() == '@') {
|
||||||
dmang.increment(); // Skip past @.
|
dmang.increment(); // Skip past @.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue