summaryrefslogtreecommitdiffstats
path: root/media/mtp/MtpDevice.h
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@google.com>2014-11-12 14:20:06 -0800
committerMike Lockwood <lockwood@google.com>2014-11-12 16:08:37 -0800
commitab063847e6e893740749029a04cce1f6b7345ed5 (patch)
tree8b840e9152cfa638aa354a0379962a89914e0006 /media/mtp/MtpDevice.h
parent745602d87607521f4fe84c4f3a6388fbdb6a867c (diff)
downloadframeworks_av-ab063847e6e893740749029a04cce1f6b7345ed5.zip
frameworks_av-ab063847e6e893740749029a04cce1f6b7345ed5.tar.gz
frameworks_av-ab063847e6e893740749029a04cce1f6b7345ed5.tar.bz2
MTP: add strict bounds checking for all incoming packets
Previously we did not sanity check incoming MTP packets, which could result in crashes due to reading off the edge of a packet. Now all MTP packet getter functions return a boolean result (true for OK, false for reading off the edge of the packet) and we now return errors for malformed packets. Bug: 18113092 Change-Id: Ic7623ee96f00652bdfb4f66acb16a93db5a1c105
Diffstat (limited to 'media/mtp/MtpDevice.h')
-rw-r--r--media/mtp/MtpDevice.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/media/mtp/MtpDevice.h b/media/mtp/MtpDevice.h
index b69203e..9b0acbf 100644
--- a/media/mtp/MtpDevice.h
+++ b/media/mtp/MtpDevice.h
@@ -98,7 +98,7 @@ public:
bool readObject(MtpObjectHandle handle,
bool (* callback)(void* data, int offset,
int length, void* clientData),
- int objectSize, void* clientData);
+ size_t objectSize, void* clientData);
bool readObject(MtpObjectHandle handle, const char* destPath, int group,
int perm);