2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

table: Avoid segmentation fault when printing an empty cell in JSON format.

Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Ben Pfaff
2012-01-27 12:37:45 -08:00
parent 2a4999f3f3
commit 8d56fd267c

View File

@@ -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);