mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-24 14:23:36 -05:00
fixed potential integer overflow / Out of bounds read in RsVOIPDataItem.cc
This commit is contained in:
parent
98f0c101b9
commit
6e9d96efd8
@ -447,6 +447,9 @@ RsVOIPDataItem::RsVOIPDataItem(void *data, uint32_t pktsize)
|
||||
ok &= getRawUInt32(data, rssize, &offset, &flags);
|
||||
ok &= getRawUInt32(data, rssize, &offset, &data_size);
|
||||
|
||||
if(data_size > rssize || rssize - data_size < offset)
|
||||
throw std::runtime_error("Not enough space.") ;
|
||||
|
||||
voip_data = malloc(data_size) ;
|
||||
memcpy(voip_data,&((uint8_t*)data)[offset],data_size) ;
|
||||
offset += data_size ;
|
||||
|
Loading…
Reference in New Issue
Block a user