mirror of
https://github.com/fltk/fltk.git
synced 2026-05-26 01:46:58 +08:00
Applying patch for buffer overflow provided by Michael Sartain on fltk.coredev 02/10/2016
Subject: Fl_Tree::item_pathname() byte overflow git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@11177 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+1
-1
@@ -1229,7 +1229,7 @@ int Fl_Tree::item_pathname(char *pathname, int pathnamelen, const Fl_Tree_Item *
|
||||
SAFE_RCAT('/'); // rcat leading slash
|
||||
item = item->parent(); // move up tree (NULL==root)
|
||||
}
|
||||
if ( *(++s) == '/' ) ++s; // leave off leading slash from pathname
|
||||
if ( *(++s) == '/' ) { ++s; --slen; } // leave off leading slash from pathname
|
||||
if ( s != pathname ) memmove(pathname, s, slen); // Shift down right-aligned string
|
||||
return(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user