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/QPDF_Name.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/QPDF_Name.cc')
-rw-r--r-- | libqpdf/QPDF_Name.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libqpdf/QPDF_Name.cc b/libqpdf/QPDF_Name.cc index 26bd8263..0c2082c4 100644 --- a/libqpdf/QPDF_Name.cc +++ b/libqpdf/QPDF_Name.cc @@ -21,10 +21,10 @@ QPDF_Name::normalizeName(std::string const& name) return name; } std::string result; - result += name[0]; + result += name.at(0); for (unsigned int i = 1; i < name.length(); ++i) { - char ch = name[i]; + char ch = name.at(i); // Don't use locale/ctype here; follow PDF spec guidelines. if (strchr("#()<>[]{}/%", ch) || (ch < 33) || (ch > 126)) { |