]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/termtable.c
lib: protect termtable from bad fmt string
[mirror_frr.git] / lib / termtable.c
index 4f5f9ff218ef724de1e9e40c3b6966b3c21d57ea..01468b820363645e746a3f0ef53753f04b523941 100644 (file)
@@ -163,7 +163,7 @@ static struct ttable_cell *ttable_insert_row_va(struct ttable *tt, int i,
 
        orig = res;
 
-       while (res) {
+       while (res && col < tt->ncols) {
                section = strsep(&res, "|");
                row[col].text = XSTRDUP(MTYPE_TTABLE, section);
                row[col].style = tt->style.cell;