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

Unified Diff: include/core/SkPath.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: Removing SkMatrix's writeToMemory, readFromMemory 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
Index: include/core/SkPath.h
diff --git a/include/core/SkPath.h b/include/core/SkPath.h
index a6674d9afb4e65cc024ee8a155d5f4f4b4869bfe..26afdf48c6e0fda9734aa843c1975e0ae9e89cae 100644
--- a/include/core/SkPath.h
+++ b/include/core/SkPath.h
@@ -910,15 +910,18 @@ public:
void dump() const;
/**
- * Write the region to the buffer, and return the number of bytes written.
+ * Write the path to the buffer, and return the number of bytes written.
* If buffer is NULL, it still returns the number of bytes.
*/
uint32_t writeToMemory(void* buffer) const;
/**
- * Initialized the region from the buffer, returning the number
- * of bytes actually read.
+ * Initializes the path from the buffer
+ *
+ * @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 readFromMemory(const void* buffer, uint32_t length);
#ifdef SK_BUILD_FOR_ANDROID
uint32_t getGenerationID() const;
« no previous file with comments | « include/core/SkMatrix.h ('k') | include/core/SkReader32.h » ('j') | include/core/SkReader32.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698