mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
Vulnerability fixes
This commit is contained in:
@@ -1132,7 +1132,17 @@ void ParseV3000ParseLabel(const std::string &label,
|
||||
} else if (label == "PARENT") {
|
||||
// Store relationship until all SGroups have been read
|
||||
unsigned int parentIdx;
|
||||
if (lineStream.eof()) {
|
||||
std::ostringstream errout;
|
||||
errout << "PARENT label not found on line " << line;
|
||||
throw FileParseException(errout.str());
|
||||
}
|
||||
lineStream >> parentIdx;
|
||||
if (lineStream.fail()) {
|
||||
std::ostringstream errout;
|
||||
errout << "Invalid PARENT label found on line " << line;
|
||||
throw FileParseException(errout.str());
|
||||
}
|
||||
sgroup.setProp<unsigned int>("PARENT", parentIdx);
|
||||
} else if (label == "COMPNO") {
|
||||
unsigned int compno;
|
||||
|
||||
@@ -692,6 +692,7 @@ template <typename Iterator>
|
||||
void parse_data_sgroup_attr(Iterator &first, Iterator last,
|
||||
SubstanceGroup &sgroup, bool keepSGroup,
|
||||
std::string fieldName, bool fieldIsArray = false) {
|
||||
PRECONDITION(first < last);
|
||||
if (first != last && *first != '|') {
|
||||
std::string data = read_text_to(first, last, ":");
|
||||
++first;
|
||||
@@ -744,7 +745,7 @@ bool parse_data_sgroup(Iterator &first, Iterator last, RDKit::RWMol &mol,
|
||||
}
|
||||
|
||||
parse_data_sgroup_attr(first, last, sgroup, keepSGroup, "DATAFIELDS", true);
|
||||
|
||||
|
||||
parse_data_sgroup_attr(first, last, sgroup, keepSGroup, "QUERYOP");
|
||||
|
||||
parse_data_sgroup_attr(first, last, sgroup, keepSGroup, "FIELDINFO");
|
||||
|
||||
Reference in New Issue
Block a user