diff options
author | Jay Berkenbilt <ejb@ql.org> | 2013-10-06 01:42:39 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2013-10-18 16:45:14 +0200 |
commit | ac9c1f0d560540fda821b2775a475c71b47cb3a0 (patch) | |
tree | 20acd9a49718d0dd4efc15fd2e7b37a6c09c75a2 /libqpdf/QPDFObjectHandle.cc | |
parent | 4229457068d6a28cc11b506f127a7bb650ab18c1 (diff) | |
download | qpdf-ac9c1f0d560540fda821b2775a475c71b47cb3a0.tar.zst |
Security: replace operator[] with at
For std::string and std::vector, replace operator[] with at. This was
done using an automated process. See README.hardening for details.
Diffstat (limited to 'libqpdf/QPDFObjectHandle.cc')
-rw-r--r-- | libqpdf/QPDFObjectHandle.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index 442678fd..ef92e3ac 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -712,7 +712,7 @@ QPDFObjectHandle::parse(std::string const& object_str, size_t offset = input->tell(); while (offset < object_str.length()) { - if (! isspace(object_str[offset])) + if (! isspace(object_str.at(offset))) { QTC::TC("qpdf", "QPDFObjectHandle trailing data in parse"); throw QPDFExc(qpdf_e_damaged_pdf, input->getName(), @@ -966,8 +966,8 @@ QPDFObjectHandle::parseInternal(PointerHolder<InputSource> input, std::string const& value = token.getValue(); if ((value == "R") && (in_array || in_dictionary) && (olist.size() >= 2) && - (olist[olist.size() - 1].isInteger()) && - (olist[olist.size() - 2].isInteger())) + (olist.at(olist.size() - 1).isInteger()) && + (olist.at(olist.size() - 2).isInteger())) { if (context == 0) { @@ -979,8 +979,8 @@ QPDFObjectHandle::parseInternal(PointerHolder<InputSource> input, // Try to resolve indirect objects object = newIndirect( context, - olist[olist.size() - 2].getIntValue(), - olist[olist.size() - 1].getIntValue()); + olist.at(olist.size() - 2).getIntValue(), + olist.at(olist.size() - 1).getIntValue()); olist.pop_back(); olist.pop_back(); } @@ -1067,8 +1067,8 @@ QPDFObjectHandle::parseInternal(PointerHolder<InputSource> input, } for (unsigned int i = 0; i < olist.size(); i += 2) { - QPDFObjectHandle key_obj = olist[i]; - QPDFObjectHandle val = olist[i + 1]; + QPDFObjectHandle key_obj = olist.at(i); + QPDFObjectHandle val = olist.at(i + 1); if (! key_obj.isName()) { throw QPDFExc( |