Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: native_client_sdk/src/libraries/nacl_io/path.cc

Issue 1018393007: [NaCl SDK] nacl_io: Fix bug in Path::Range introduced in recent change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add additional tests for values completely outside the range Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | native_client_sdk/src/tests/nacl_io_test/path_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/libraries/nacl_io/path.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/path.cc b/native_client_sdk/src/libraries/nacl_io/path.cc
index 21965607911902157416e8870a35ba24650c4e78..e75f0683831cd8bef5ec73c6f45ca93fc085866d 100644
--- a/native_client_sdk/src/libraries/nacl_io/path.cc
+++ b/native_client_sdk/src/libraries/nacl_io/path.cc
@@ -170,7 +170,7 @@ std::string Path::Range(size_t start, size_t end) const {
}
}
- if (pstart > pend)
+ if (slashes < start || pstart > pend)
return std::string();
return std::string(pstart, pend - pstart);
« no previous file with comments | « no previous file | native_client_sdk/src/tests/nacl_io_test/path_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698