summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaichi Hirono2016-12-05 01:50:44 -0600
committerDaichi Hirono2016-12-11 23:34:29 -0600
commita6373ec1d47c0b370c87b3915feeba8f2b4523f7 (patch)
treed8e532d25edd551db366b825e96f22a69faf8b48 /libappfuse/include/libappfuse
parent4b4475308598659137657261218fc5a3207ec79c (diff)
downloadplatform-system-core-a6373ec1d47c0b370c87b3915feeba8f2b4523f7.tar.gz
platform-system-core-a6373ec1d47c0b370c87b3915feeba8f2b4523f7.tar.xz
platform-system-core-a6373ec1d47c0b370c87b3915feeba8f2b4523f7.zip
Fix checks for reading and writing FuseMessage.
Previously FuseMessage were checking result of read/write operation after checking header.len value is valid. This was wrong because header.len does not contain correct value when read function does not read any bytes and returns zero. Bug: 33278098 Test: libappfuse_test Change-Id: Icf998ca6c3eeee20cbc4aa2f65195a87e59ffc27
Diffstat (limited to 'libappfuse/include/libappfuse')
-rw-r--r--libappfuse/include/libappfuse/FuseBuffer.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/libappfuse/include/libappfuse/FuseBuffer.h b/libappfuse/include/libappfuse/FuseBuffer.h
index e7f620cb6..276db9020 100644
--- a/libappfuse/include/libappfuse/FuseBuffer.h
+++ b/libappfuse/include/libappfuse/FuseBuffer.h
@@ -34,8 +34,9 @@ class FuseMessage {
34 bool Read(int fd); 34 bool Read(int fd);
35 bool Write(int fd) const; 35 bool Write(int fd) const;
36 private: 36 private:
37 bool CheckHeaderLength() const; 37 bool CheckPacketSize(size_t size, const char* name) const;
38 bool CheckResult(int result, const char* operation_name) const; 38 bool CheckResult(int result, const char* operation_name) const;
39 bool CheckHeaderLength(int result, const char* operation_name) const;
39}; 40};
40 41
41// FuseRequest represents file operation requests from /dev/fuse. It starts 42// FuseRequest represents file operation requests from /dev/fuse. It starts