Fix out-of-bounds read in FileSystemFilter::Cleanup
Fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33238pull/4146/head
parent
6f07e89fdf
commit
e900617796
|
@ -300,13 +300,14 @@ private:
|
|||
|
||||
const char separator = getOsSeparator();
|
||||
for (it = in.begin(); it != in.end(); ++it) {
|
||||
int remaining = std::distance(in.end(), it);
|
||||
// Exclude :// and \\, which remain untouched.
|
||||
// https://sourceforge.net/tracker/?func=detail&aid=3031725&group_id=226462&atid=1067632
|
||||
if ( !strncmp(&*it, "://", 3 )) {
|
||||
if (remaining >= 3 && !strncmp(&*it, "://", 3 )) {
|
||||
it += 3;
|
||||
continue;
|
||||
}
|
||||
if (it == in.begin() && !strncmp(&*it, "\\\\", 2)) {
|
||||
if (it == in.begin() && remaining >= 2 && !strncmp(&*it, "\\\\", 2)) {
|
||||
it += 2;
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue