+ /**
+ * Throw an error if size*count overflows
+ */
+ size_t verifyLength(size_t offset, size_t size, le_uint32 count, LEErrorCode &success) {
+ if(count!=0 && size>LE_UINT32_MAX/count) {
+ LE_DEBUG_TR3("verifyLength failed size=%u, count=%u", size, count);
+ success = LE_INDEX_OUT_OF_BOUNDS_ERROR;
+ return 0;
+ }
+ return verifyLength(offset, size*count, success);
+ }
+