mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-17 13:24:15 -05:00
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:
parent
d3257e4455
commit
d870b13a49
@ -473,7 +473,7 @@ bool RsTlvFileSet::GetTlv(void *data, uint32_t size, uint32_t *offset)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint16_t tlvtype = GetTlvType( &(((uint8_t *) data)[*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;
|
uint32_t tlvend = *offset + tlvsize;
|
||||||
|
|
||||||
if (size < tlvend) /* check size */
|
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 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;
|
uint32_t tlvend = *offset + tlvsize;
|
||||||
|
|
||||||
if (size < tlvend) /* check size */
|
if (size < tlvend) /* check size */
|
||||||
|
@ -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 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;
|
uint32_t tlvend = *offset + tlvsize;
|
||||||
|
|
||||||
if (size < tlvend) /* check size */
|
if (size < tlvend) /* check size */
|
||||||
|
@ -471,7 +471,7 @@ bool RsTlvKeySignature::GetTlv(void *data, uint32_t size, uint32_t *offset)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint16_t tlvtype = GetTlvType( &(((uint8_t *) data)[*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;
|
uint32_t tlvend = *offset + tlvsize;
|
||||||
|
|
||||||
if (size < tlvend) /* check size */
|
if (size < tlvend) /* check size */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user