summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_message_utils.cc
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 /ipc/ipc_message_utils.cc
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 'ipc/ipc_message_utils.cc')
-rw-r--r--ipc/ipc_message_utils.cc11
1 files changed, 2 insertions, 9 deletions
diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc
index dd310c1..432853c 100644
--- a/ipc/ipc_message_utils.cc
+++ b/ipc/ipc_message_utils.cc
@@ -489,20 +489,13 @@ void ParamTraits<base::FileDescriptor>::Log(const param_type& p,
#endif // defined(OS_POSIX)
void ParamTraits<FilePath>::Write(Message* m, const param_type& p) {
- ParamTraits<FilePath::StringType>::Write(m, p.value());
+ p.WriteToPickle(m);
}
bool ParamTraits<FilePath>::Read(const Message* m,
PickleIterator* iter,
param_type* r) {
- FilePath::StringType value;
- if (!ParamTraits<FilePath::StringType>::Read(m, iter, &value))
- return false;
- // Reject embedded NULs as they can cause security checks to go awry.
- if (value.find(FILE_PATH_LITERAL('\0')) != FilePath::StringType::npos)
- return false;
- *r = FilePath(value);
- return true;
+ return r->ReadFromPickle(iter);
}
void ParamTraits<FilePath>::Log(const param_type& p, std::string* l) {