aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p@janouch.name>2018-10-02 23:18:50 +0200
committerPřemysl Janouch <p@janouch.name>2018-10-03 22:47:47 +0200
commitad239714b0f9fb806abfbb0fbe4420e7304cb09f (patch)
tree4e2ad0649c19a96492dbfc80f7b10dfb0338ad64
parentdaa9cc1ed445e95f523f122eb383f7853fcd38df (diff)
downloadpdf-simple-sign-ad239714b0f9fb806abfbb0fbe4420e7304cb09f.tar.gz
pdf-simple-sign-ad239714b0f9fb806abfbb0fbe4420e7304cb09f.tar.xz
pdf-simple-sign-ad239714b0f9fb806abfbb0fbe4420e7304cb09f.zip
Add comments about some potential issues
- lack of number range verification - lack of sanitization when serializing dicts
-rw-r--r--pdf-simple-sign.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/pdf-simple-sign.cpp b/pdf-simple-sign.cpp
index ec2e6ae..a2947dd 100644
--- a/pdf-simple-sign.cpp
+++ b/pdf-simple-sign.cpp
@@ -301,6 +301,7 @@ static std::string pdf_serialize(const pdf_object& o) {
{
std::string s;
for (const auto i : o.dict)
+ // FIXME the key is also supposed to be escaped by pdf_serialize()
s += " /" + i.first + " " + pdf_serialize(i.second);
return "<<" + s + " >>";
}
@@ -543,6 +544,7 @@ std::string pdf_updater::initialize() {
const auto prev_offset = trailer.dict.find("Prev");
if (prev_offset == trailer.dict.end())
break;
+ // FIXME we don't check for size_t over or underflow
if (!prev_offset->second.is_integer())
return "invalid Prev offset";
xref_offset = prev_offset->second.number;