From b097d7a81b5c9cb349fff5c1efe6a0c390025579 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 5 Oct 2013 05:52:42 -0400 Subject: Security: handle empty name in normalizeName --- libqpdf/QPDF_Name.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libqpdf') diff --git a/libqpdf/QPDF_Name.cc b/libqpdf/QPDF_Name.cc index 9adb25b5..26bd8263 100644 --- a/libqpdf/QPDF_Name.cc +++ b/libqpdf/QPDF_Name.cc @@ -16,6 +16,10 @@ QPDF_Name::~QPDF_Name() std::string QPDF_Name::normalizeName(std::string const& name) { + if (name.empty()) + { + return name; + } std::string result; result += name[0]; for (unsigned int i = 1; i < name.length(); ++i) -- cgit v1.2.3-54-g00ecf