git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
table: Avoid segmentation fault when printing an empty cell in JSON format.
[sliver-openvswitch.git]
/
lib
/
table.c
diff --git
a/lib/table.c
b/lib/table.c
index
ff11e78
..
537fae9
100644
(file)
--- 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));
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));
json_array_add(row, json_clone(cell->json));
+ } else {
+ json_array_add(row, json_null_create());
}
}
json_array_add(data, row);
}
}
json_array_add(data, row);