summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-07-09 17:18:45 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-07-09 17:18:45 +0000
commit0cca48696f20a169f943b1624f7e4953f0736e05 (patch)
treed014120dd62a7820a5fa704f2fc7e29f8dd5846a
parent81d431ccf556514c8a4f63d8f85617af3b6024ba (diff)
Range check input to Fl_Choice::value(n).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2497 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES1
-rw-r--r--src/Fl_Choice.cxx5
2 files changed, 4 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 45fdb22c8..03c9940c0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,6 @@
CHANGES IN FLTK 1.1.0
+ - Fl_Choice::value(n) didn't range check "n".
- The MingW and OS/2 makeinclude files didn't have the
new fltk_images library definitions.
- Fl_Text_Editor didn't scroll the text in the widget
diff --git a/src/Fl_Choice.cxx b/src/Fl_Choice.cxx
index 3ed71d97c..23b4ac094 100644
--- a/src/Fl_Choice.cxx
+++ b/src/Fl_Choice.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Choice.cxx,v 1.10.2.5.2.9 2002/04/11 10:46:19 easysw Exp $"
+// "$Id: Fl_Choice.cxx,v 1.10.2.5.2.10 2002/07/09 17:18:45 easysw Exp $"
//
// Choice widget for the Fast Light Tool Kit (FLTK).
//
@@ -85,6 +85,7 @@ Fl_Choice::Fl_Choice(int x,int y,int w,int h, const char *l)
}
int Fl_Choice::value(int v) {
+ if (v < 0 || v >= (size() - 1)) return 0;
if (!Fl_Menu_::value(v)) return 0;
redraw();
return 1;
@@ -128,5 +129,5 @@ int Fl_Choice::handle(int e) {
}
//
-// End of "$Id: Fl_Choice.cxx,v 1.10.2.5.2.9 2002/04/11 10:46:19 easysw Exp $".
+// End of "$Id: Fl_Choice.cxx,v 1.10.2.5.2.10 2002/07/09 17:18:45 easysw Exp $".
//