From d7ee810bc02c4b431faadf0eef43fc79a125e9ae Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 31 Dec 2018 12:27:00 -0800 Subject: [PATCH] ircd::parse: Fix misconstruction; fix loop condition. --- include/ircd/parse.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ircd/parse.h b/include/ircd/parse.h index fb32e7365..fda535384 100644 --- a/include/ircd/parse.h +++ b/include/ircd/parse.h @@ -54,7 +54,7 @@ struct ircd::parse::buffer :base{data(mb)} ,parsed{data(mb)} ,read{data(mb) + old.unparsed()} - ,stop{stop} + ,stop{data(mb) + ircd::size(mb)} { memmove(base, old.base, old.unparsed()); } @@ -113,7 +113,7 @@ inline void ircd::parse::capstan::operator()(const parse_closure &pc) try { - while(!pc(parsed, const_cast(read))) + while(!pc(parsed, const_cast(read)) && read != stop) reader(read, stop); } catch(const std::bad_function_call &e)