fixed potential integer problems in de-serialization of different TLV items (patch from Henry)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8574 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
electron128 2015-07-01 12:17:03 +00:00
parent d3257e4455
commit d870b13a49
3 changed files with 4 additions and 4 deletions

View File

@ -473,7 +473,7 @@ bool RsTlvFileSet::GetTlv(void *data, uint32_t size, uint32_t *offset)
return false;
uint16_t tlvtype = GetTlvType( &(((uint8_t *) data)[*offset]) );
uint16_t tlvsize = GetTlvSize( &(((uint8_t *) data)[*offset]) );
uint32_t tlvsize = GetTlvSize( &(((uint8_t *) data)[*offset]) );
uint32_t tlvend = *offset + tlvsize;
if (size < tlvend) /* check size */
@ -645,7 +645,7 @@ bool RsTlvFileData::GetTlv(void *data, uint32_t size, uint32_t *offset)
}
uint16_t tlvtype = GetTlvType( &(((uint8_t *) data)[*offset]) );
uint16_t tlvsize = GetTlvSize( &(((uint8_t *) data)[*offset]) );
uint32_t tlvsize = GetTlvSize( &(((uint8_t *) data)[*offset]) );
uint32_t tlvend = *offset + tlvsize;
if (size < tlvend) /* check size */

View File

@ -135,7 +135,7 @@ bool RsTlvUnit::GetTlv(void *data, uint32_t size, uint32_t *offset)
}
uint16_t tlvtype = GetTlvType( &(((uint8_t *) data)[*offset]) );
uint16_t tlvsize = GetTlvSize( &(((uint8_t *) data)[*offset]) );
uint32_t tlvsize = GetTlvSize( &(((uint8_t *) data)[*offset]) );
uint32_t tlvend = *offset + tlvsize;
if (size < tlvend) /* check size */

View File

@ -471,7 +471,7 @@ bool RsTlvKeySignature::GetTlv(void *data, uint32_t size, uint32_t *offset)
return false;
uint16_t tlvtype = GetTlvType( &(((uint8_t *) data)[*offset]) );
uint16_t tlvsize = GetTlvSize( &(((uint8_t *) data)[*offset]) );
uint32_t tlvsize = GetTlvSize( &(((uint8_t *) data)[*offset]) );
uint32_t tlvend = *offset + tlvsize;
if (size < tlvend) /* check size */