aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_encryption.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/QPDF_encryption.cc')
-rw-r--r--libqpdf/QPDF_encryption.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/libqpdf/QPDF_encryption.cc b/libqpdf/QPDF_encryption.cc
index 9607a598..d5289ad3 100644
--- a/libqpdf/QPDF_encryption.cc
+++ b/libqpdf/QPDF_encryption.cc
@@ -1211,10 +1211,10 @@ QPDF::decryptString(std::string& str, int objid, int generation)
size_t vlen = str.length();
// Using PointerHolder guarantees that tmp will
// be freed even if rc4.process throws an exception.
- PointerHolder<char> tmp(true, QUtil::copy_string(str));
+ auto tmp = QUtil::make_shared_cstr(str);
RC4 rc4(QUtil::unsigned_char_pointer(key), toI(key.length()));
- rc4.process(QUtil::unsigned_char_pointer(tmp.getPointer()), vlen);
- str = std::string(tmp.getPointer(), vlen);
+ rc4.process(QUtil::unsigned_char_pointer(tmp.get()), vlen);
+ str = std::string(tmp.get(), vlen);
}
}
catch (QPDFExc&)