summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-11-19 16:59:22 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-11-19 16:59:22 +0000
commitb553a344189d3e54e8092397f559ce5774341fe7 (patch)
tree8a81e7a21c6a56907e77321fb91444d03f311279 /src
parent1e4a969337850e87d5de5ada49c1c28e98072b53 (diff)
Increase label buffer size and bounds-check all writes.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2847 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Menu_add.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Fl_Menu_add.cxx b/src/Fl_Menu_add.cxx
index 0b880c3b5..ac33e1a2d 100644
--- a/src/Fl_Menu_add.cxx
+++ b/src/Fl_Menu_add.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Menu_add.cxx,v 1.9.2.13.2.5 2002/10/01 18:37:27 easysw Exp $"
+// "$Id: Fl_Menu_add.cxx,v 1.9.2.13.2.6 2002/11/19 16:59:22 easysw Exp $"
//
// Menu utilities for the Fast Light Tool Kit (FLTK).
//
@@ -219,12 +219,12 @@ int Fl_Menu_::add(const char *t, int s, Fl_Callback *c,void *v,int f) {
// adds many menu items, with '|' seperating the menu items, and tab
// seperating the menu item names from an optional shortcut string.
int Fl_Menu_::add(const char *str) {
- char buf[128];
+ char buf[1024];
int r = 0;
while (*str) {
int sc = 0;
char *c;
- for (c = buf; *str && *str != '|'; str++) {
+ for (c = buf; c < (buf + sizeof(buf) - 2) && *str && *str != '|'; str++) {
if (*str == '\t') {*c++ = 0; sc = fl_old_shortcut(str);}
else *c++ = *str;
}
@@ -262,5 +262,5 @@ void Fl_Menu_::remove(int i) {
}
//
-// End of "$Id: Fl_Menu_add.cxx,v 1.9.2.13.2.5 2002/10/01 18:37:27 easysw Exp $".
+// End of "$Id: Fl_Menu_add.cxx,v 1.9.2.13.2.6 2002/11/19 16:59:22 easysw Exp $".
//