mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-24 17:10:08 +01:00
cli: fix out of bounds access in _print_fill()
cols_len might be larger than header_row->len. That is when the cols has entries that are not leaf entries (which currently I think is never the case). Fix it to use the right variable for the length of the row.
This commit is contained in:
parent
5bef7d7453
commit
3d2b982fb7
1 changed files with 2 additions and 1 deletions
|
|
@ -1140,7 +1140,8 @@ _print_fill (const NmcConfig *nmc_config,
|
|||
header_cell->width = nmc_string_screen_width (header_cell->title, NULL);
|
||||
|
||||
for (i_row = 0; i_row < targets_len; i_row++) {
|
||||
const PrintDataCell *cell = &g_array_index (cells, PrintDataCell, i_row * cols_len + i_col);
|
||||
const PrintDataCell *cells_line = &g_array_index (cells, PrintDataCell, i_row * header_row->len);
|
||||
const PrintDataCell *cell = &cells_line[i_col];
|
||||
const char *const*i_strv;
|
||||
|
||||
switch (cell->text_format) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue