Thanks! On Thu, Oct 11, 2018 at 1:02 PM Ben Pfaff <[email protected]> wrote:
> On Wed, Oct 10, 2018 at 03:15:52PM -0700, Yifeng Sun wrote: > > This patch checks the depth of nested parentheses to prevent > > stack overflow. Since is_chassis_resident doesn't allow > > nested parentheses, its following parentheses are not taken > > into acount in the parentheses-depth context. > > > > Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10714 > > Signed-off-by: Yifeng Sun <[email protected]> > > Suggested-by: Ben Pfaff <[email protected]> > > --- > > v1->v2: Handle parse_chassis_resident and add new test, thanks Ben! > > v2->v3: Ignore parentheses from chassis resident. > > Thanks a lot for the updated patch. > > The grammar of the error message wasn't quite right, so I adjusted it. > > I wanted to always keep the depth counter correct, even if there was an > error, so I moved the updates, like this: > > if (ctx->paren_depth >= MAX_PAREN_DEPTH) { > lexer_error(ctx->lexer, "Parentheses nested too deeply."); > return NULL; > } > > ctx->paren_depth++; > struct expr *e = expr_parse__(ctx); > ctx->paren_depth--; > > The unbalanced parentheses in the test were confusing my editor, so I > balanced them. > > And then I applied this to master and backported it as far as > branch-2.7. Thanks again! > _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
