summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml/cfx_saxreaderhandler.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-07-18 16:10:39 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-07-19 13:21:00 +0000
commit23c93ef6e3b9a289cdcece487b314325a21b28ff (patch)
tree6fed85255a2f7d7e07aa7832aca04145c8862475 /core/fxcrt/xml/cfx_saxreaderhandler.cpp
parentd0f1054087094e5c353aead6bc3370635b69b278 (diff)
downloadpdfium-23c93ef6e3b9a289cdcece487b314325a21b28ff.tar.xz
Avoid unterminated string segment in cfx_saxreaderhandler.cpp
Use the overloaded << operator, which takes length into account for StringC types, rather than a raw ptr (which gets promoted into a std::string resulting in a length call that overflows since StringCs aren't necessarily nul-terminated). Bug: 746073 Change-Id: Iffbbff53e12da8741acc7ce54000232cc66d83bc Reviewed-on: https://pdfium-review.googlesource.com/8150 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/xml/cfx_saxreaderhandler.cpp')
-rw-r--r--core/fxcrt/xml/cfx_saxreaderhandler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/fxcrt/xml/cfx_saxreaderhandler.cpp b/core/fxcrt/xml/cfx_saxreaderhandler.cpp
index 9967f3eea8..f1e0c7ad94 100644
--- a/core/fxcrt/xml/cfx_saxreaderhandler.cpp
+++ b/core/fxcrt/xml/cfx_saxreaderhandler.cpp
@@ -30,7 +30,7 @@ CFX_SAXContext* CFX_SAXReaderHandler::OnTagEnter(
if (eType == CFX_SAXItem::Type::Instruction)
m_SAXContext.m_TextBuf << "?";
- m_SAXContext.m_TextBuf << bsTagName.c_str();
+ m_SAXContext.m_TextBuf << bsTagName;
m_SAXContext.m_bsTagName = bsTagName;
return &m_SAXContext;
}