aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/util.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-04-17 13:28:29 -0400
committerMarcoFalke <falke.marco@gmail.com>2020-06-26 13:46:29 -0400
commitfa8ec00061567e56333bb69c5623919d45a9a92d (patch)
treeff4cb4c06d5f83f3243bc684bbbf95600481fe0e /src/rpc/util.cpp
parentf32f7e907a5eb73e880c567c699569081608ed7a (diff)
downloadbitcoin-fa8ec00061567e56333bb69c5623919d45a9a92d.tar.xz
rpc: Check that left section is not multiline
Diffstat (limited to 'src/rpc/util.cpp')
-rw-r--r--src/rpc/util.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp
index 54ea352a72..d476feb962 100644
--- a/src/rpc/util.cpp
+++ b/src/rpc/util.cpp
@@ -381,6 +381,9 @@ struct Sections {
std::string ret;
const size_t pad = m_max_pad + 4;
for (const auto& s : m_sections) {
+ // The left part of a section is assumed to be a single line, usually it is the name of the JSON struct or a
+ // brace like {, }, [, or ]
+ CHECK_NONFATAL(s.m_left.find('\n') == std::string::npos);
if (s.m_right.empty()) {
ret += s.m_left;
ret += "\n";