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_ */ |