[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openvswitch-dev
Subject:    [ovs-dev] [PATCH] table: Avoid segmentation fault when printing an empty cell in JSON format.
From:       blp () nicira ! com (Ben Pfaff)
Date:       2012-01-30 17:13:34
Message-ID: 20120130171334.GB10646 () nicira ! com
[Download RAW message or body]

Thanks.  I pushed this to master and the branches for 1.2, 1.3, 1.4,
and 1.5.

On Fri, Jan 27, 2012 at 01:23:11PM -0800, Ethan Jackson wrote:
> Looks good.
> 
> Ethan
> 
> On Fri, Jan 27, 2012 at 12:50, Ben Pfaff <blp at nicira.com> wrote:
> > Signed-off-by: Ben Pfaff <blp at nicira.com>
> > ---
> > ?lib/table.c | ? ?4 +++-
> > ?1 files changed, 3 insertions(+), 1 deletions(-)
> >
> > diff --git a/lib/table.c b/lib/table.c
> > index ff11e78..537fae9 100644
> > --- a/lib/table.c
> > +++ b/lib/table.c
> > @@ -480,8 +480,10 @@ table_print_json__(const struct table *table, const struct table_style *style)
> > ? ? ? ? ? ? const struct cell *cell = table_cell__(table, y, x);
> > ? ? ? ? ? ? if (cell->text) {
> > ? ? ? ? ? ? ? ? json_array_add(row, json_string_create(cell->text));
> > - ? ? ? ? ? ?} else {
> > + ? ? ? ? ? ?} else if (cell->json) {
> > ? ? ? ? ? ? ? ? json_array_add(row, json_clone(cell->json));
> > + ? ? ? ? ? ?} else {
> > + ? ? ? ? ? ? ? ?json_array_add(row, json_null_create());
> > ? ? ? ? ? ? }
> > ? ? ? ? }
> > ? ? ? ? json_array_add(data, row);
> > --
> > 1.7.2.5
> >
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> > http://openvswitch.org/mailman/listinfo/dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic