Skip to content

Commit

Permalink
Range check the visLineNum argument...
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2846 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
michaelrsweet committed Nov 19, 2002
1 parent a74795b commit 1e4a969
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Fl_Text_Display.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_Text_Display.cxx,v 1.12.2.38 2002/11/19 16:37:35 easysw Exp $"
// "$Id: Fl_Text_Display.cxx,v 1.12.2.39 2002/11/19 16:45:32 easysw Exp $"
//
// Copyright 2001-2002 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
Expand Down Expand Up @@ -2278,7 +2278,12 @@ int Fl_Text_Display::empty_vlines() {
** entries in the line starts array rather than by scanning for newlines
*/
int Fl_Text_Display::vline_length( int visLineNum ) {
int nextLineStart, lineStartPos = mLineStarts[ visLineNum ];
int nextLineStart, lineStartPos;

if (visLineNum < 0 || visLineNum >= mNVisibleLines)
return (0);

lineStartPos = mLineStarts[ visLineNum ];

if ( lineStartPos == -1 )
return 0;
Expand Down Expand Up @@ -3030,5 +3035,5 @@ int Fl_Text_Display::handle(int event) {


//
// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.38 2002/11/19 16:37:35 easysw Exp $".
// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.39 2002/11/19 16:45:32 easysw Exp $".
//

0 comments on commit 1e4a969

Please sign in to comment.