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

Unified Diff: include/core/SkMatrix.h

Issue 41253002: Checking structure sizes before reading them from memory to avoid overflowing the buffer's stream. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Revert back to Patch Set 4 Created 7 years, 2 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 | include/core/SkPath.h » ('j') | include/core/SkReader32.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkMatrix.h
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h
index b6856d103c57fe45849b51c2d77c5d7449552afa..3350715c375729b0a647abc94366744d22d61218 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -560,8 +560,14 @@ public:
};
// return the number of bytes written, whether or not buffer is null
uint32_t writeToMemory(void* buffer) const;
- // return the number of bytes read
- uint32_t readFromMemory(const void* buffer);
+ /**
+ * Reads data from the buffer parameter
+ *
+ * @param buffer Memory to read from
+ * @param length Amount of memory available in the buffer
+ * @return number of bytes read or 0 if there was not enough memory available
+ */
+ uint32_t readFromMemory(const void* buffer, uint32_t length);
reed1 2013/10/29 19:42:58 size_t ?
sugoi1 2013/10/29 20:16:47 I assume this comment applies to all readFromMemor
SkDEVCODE(void dump() const;)
SkDEVCODE(void toString(SkString*) const;)
« no previous file with comments | « no previous file | include/core/SkPath.h » ('j') | include/core/SkReader32.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698