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/Pl_LZWDecoder.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/Pl_LZWDecoder.cc')
-rw-r--r-- | libqpdf/Pl_LZWDecoder.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libqpdf/Pl_LZWDecoder.cc b/libqpdf/Pl_LZWDecoder.cc index 82a668e3..2cc2077b 100644 --- a/libqpdf/Pl_LZWDecoder.cc +++ b/libqpdf/Pl_LZWDecoder.cc @@ -109,7 +109,7 @@ Pl_LZWDecoder::getFirstChar(int code) throw std::logic_error( "Pl_LZWDecoder::getFirstChar: table overflow"); } - Buffer& b = table[idx]; + Buffer& b = table.at(idx); result = b.getBuffer()[0]; } else @@ -142,7 +142,7 @@ Pl_LZWDecoder::addToTable(unsigned char next) throw std::logic_error( "Pl_LZWDecoder::addToTable: table overflow"); } - Buffer& b = table[idx]; + Buffer& b = table.at(idx); last_data = b.getBuffer(); last_size = b.getSize(); } @@ -238,7 +238,7 @@ Pl_LZWDecoder::handleCode(int code) } else { - Buffer& b = table[code - 258]; + Buffer& b = table.at(code - 258); getNext()->write(b.getBuffer(), b.getSize()); } } |