Skip to content

Commit fa8ec00

Browse files
author
MarcoFalke
committed
rpc: Check that left section is not multiline
1 parent f32f7e9 commit fa8ec00

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/rpc/util.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,9 @@ struct Sections {
381381
std::string ret;
382382
const size_t pad = m_max_pad + 4;
383383
for (const auto& s : m_sections) {
384+
// The left part of a section is assumed to be a single line, usually it is the name of the JSON struct or a
385+
// brace like {, }, [, or ]
386+
CHECK_NONFATAL(s.m_left.find('\n') == std::string::npos);
384387
if (s.m_right.empty()) {
385388
ret += s.m_left;
386389
ret += "\n";

0 commit comments

Comments
 (0)