diff options
author | eric <eric@FreeBSD.org> | 2004-02-26 01:52:39 +0000 |
---|---|---|
committer | eric <eric@FreeBSD.org> | 2004-02-26 01:52:39 +0000 |
commit | a6a3144367a5846f612889d61e3275e908ef890e (patch) | |
tree | f1109e65bf64997542bb45b2418df754565c2c93 /gnu | |
parent | 765e9ab48553da78ad846a3528e2545af3706d34 (diff) | |
download | FreeBSD-src-a6a3144367a5846f612889d61e3275e908ef890e.zip FreeBSD-src-a6a3144367a5846f612889d61e3275e908ef890e.tar.gz |
Test data before using it.
Of course, libdialog is still chock-full of similar bugs, but it's been
multiple years and no one has any better suggestions so the bugs will just
be dealt with case-by-case.
PR: 28221
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/lib/libdialog/menubox.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gnu/lib/libdialog/menubox.c b/gnu/lib/libdialog/menubox.c index 5703965..a01acd5 100644 --- a/gnu/lib/libdialog/menubox.c +++ b/gnu/lib/libdialog/menubox.c @@ -25,6 +25,7 @@ __FBSDID("$FreeBSD$"); #include <dialog.h> #include "dialog.priv.h" +#include <err.h> #include <ncurses.h> static void print_item(WINDOW *win, unsigned char *tag, unsigned char *item, int choice, int selected, dialogMenuItem *me, int menu_width, int tag_x, int item_x); @@ -442,6 +443,9 @@ static void print_item(WINDOW *win, unsigned char *tag, unsigned char *item, int choice, int selected, dialogMenuItem *me, int menu_width, int tag_x, int item_x) { int i; + + if (tag == NULL) + errx(1, "bad parameter to print_item()\n"); /* Clear 'residue' of last item */ wattrset(win, menubox_attr); |