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

Unified Diff: src/platform/vboot_reference/include/utility.h

Issue 1519008: VBoot Reference: 18 Exabytes ought to be enough for everybody (Closed)
Patch Set: Use symbolic constants. Created 10 years, 9 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 | « src/platform/vboot_reference/include/rsa_utility.h ('k') | src/platform/vboot_reference/tests/Makefile » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/vboot_reference/include/utility.h
diff --git a/src/platform/vboot_reference/include/utility.h b/src/platform/vboot_reference/include/utility.h
index 79713477c882e71b5d3735de37a6eba70fab16d1..429223cdf1ae571367982a7553b9ebfcee8f1931 100644
--- a/src/platform/vboot_reference/include/utility.h
+++ b/src/platform/vboot_reference/include/utility.h
@@ -44,7 +44,8 @@ int SafeMemcmp(const void* s1, const void* s2, size_t n);
/* Track remaining data to be read in a buffer. */
typedef struct MemcpyState {
void* remaining_buf;
- uint64_t remaining_len;
+ uint64_t remaining_len; /* Remaining length of the buffer. */
+ uint8_t overrun; /* Flag set to 1 when an overrun occurs. */
} MemcpyState;
/* Copy [len] bytes into [dst] only if there's enough data to read according
@@ -55,7 +56,7 @@ typedef struct MemcpyState {
* Useful for iterating through a binary blob to populate a struct. After the
* first failure (buffer overrun), successive calls will always fail.
*/
-void* StatefulMemcpy(MemcpyState* state, void* dst, int len);
+void* StatefulMemcpy(MemcpyState* state, void* dst, uint64_t len);
/* Like StatefulMemcpy() but copies in the opposite direction, populating
* data from [src] into the buffer encapsulated in state [state].
@@ -65,6 +66,6 @@ void* StatefulMemcpy(MemcpyState* state, void* dst, int len);
* Useful for iterating through a structure to populate a binary blob. After the
* first failure (buffer overrun), successive calls will always fail.
*/
-const void* StatefulMemcpy_r(MemcpyState* state, const void* src, int len);
+const void* StatefulMemcpy_r(MemcpyState* state, const void* src, uint64_t len);
#endif /* VBOOT_REFERENCE_UTILITY_H_ */
« no previous file with comments | « src/platform/vboot_reference/include/rsa_utility.h ('k') | src/platform/vboot_reference/tests/Makefile » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698