summaryrefslogtreecommitdiffstats
path: root/base/file_path.h
diff options
context:
space:
mode:
authoraedla@chromium.org <aedla@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-28 13:47:55 +0000
committeraedla@chromium.org <aedla@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-28 13:47:55 +0000
commitaeae59f4a1f15e80b6a726734ca6190cf111eeee (patch)
tree1eddadd678a01096f582865fe9b003fdcbab5727 /base/file_path.h
parentde6912ddcad4b29b13a5592d331ebe29cd728924 (diff)
downloadchromium_src-aeae59f4a1f15e80b6a726734ca6190cf111eeee.zip
chromium_src-aeae59f4a1f15e80b6a726734ca6190cf111eeee.tar.gz
chromium_src-aeae59f4a1f15e80b6a726734ca6190cf111eeee.tar.bz2
Don't allow '\0' characters in FilePath.
BUG=169777 Review URL: https://chromiumcodereview.appspot.com/11642041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179141 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_path.h')
-rw-r--r--base/file_path.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/base/file_path.h b/base/file_path.h
index 09e8269..81de702 100644
--- a/base/file_path.h
+++ b/base/file_path.h
@@ -53,6 +53,8 @@
// between char[]-based pathnames on POSIX systems and wchar_t[]-based
// pathnames on Windows.
//
+// Paths can't contain NULs as a precaution agaist premature truncation.
+//
// Because a FilePath object should not be instantiated at the global scope,
// instead, use a FilePath::CharType[] and initialize it with
// FILE_PATH_LITERAL. At runtime, a FilePath object can be created from the
@@ -343,7 +345,7 @@ class BASE_EXPORT FilePath {
// AsUTF8Unsafe() for details.
static FilePath FromUTF8Unsafe(const std::string& utf8);
- void WriteToPickle(Pickle* pickle);
+ void WriteToPickle(Pickle* pickle) const;
bool ReadFromPickle(PickleIterator* iter);
// Normalize all path separators to backslash on Windows