Change adu file size to be int64_t in case of larger updates (#2393)
* change adu file size to be uint64_t in case of larger updates * change to int64_t to increase ease of detection of overflow
This commit is contained in:
Родитель
a257c8c0fc
Коммит
d86ea60b65
|
@ -383,7 +383,7 @@ typedef struct
|
|||
/**
|
||||
* Size of a file, in bytes.
|
||||
*/
|
||||
uint32_t size_in_bytes;
|
||||
int64_t size_in_bytes;
|
||||
/**
|
||||
* Hashes provided for a given file in the update request.
|
||||
*/
|
||||
|
|
|
@ -780,7 +780,7 @@ AZ_NODISCARD az_result az_iot_adu_client_parse_update_manifest(
|
|||
_az_RETURN_IF_FAILED(az_json_reader_next_token(ref_json_reader));
|
||||
RETURN_IF_JSON_TOKEN_NOT_TYPE((ref_json_reader), AZ_JSON_TOKEN_NUMBER);
|
||||
|
||||
_az_RETURN_IF_FAILED(az_json_token_get_uint32(
|
||||
_az_RETURN_IF_FAILED(az_json_token_get_int64(
|
||||
&ref_json_reader->token, &update_manifest->files[files_index].size_in_bytes));
|
||||
}
|
||||
else if (az_json_token_is_text_equal(
|
||||
|
|
|
@ -412,7 +412,7 @@ static uint8_t instructions_steps_handler_properties_install_criteria[] = "1.0";
|
|||
static uint8_t files_id[] = "f2f4a804ca17afbae";
|
||||
static uint8_t files_filename[] = "iot-middleware-sample-adu-v1.1";
|
||||
static uint8_t files_id_contoso[] = "f9fec76f10aede60e";
|
||||
static uint32_t files_size_in_bytes = 844976;
|
||||
static int64_t files_size_in_bytes = 844976;
|
||||
static uint8_t files_hash_id[] = "sha256";
|
||||
static uint8_t files_hashes_sha[] = "xsoCnYAMkZZ7m9RL9Vyg9jKfFehCNxyuPFaJVM/WBi0=";
|
||||
static uint8_t created_date_time[] = "2022-07-07T03:02:48.8449038Z";
|
||||
|
|
Загрузка…
Ссылка в новой задаче