Resolve segmentation fault issue when trying to copy to outside UDVM LEFT-RIGH bounds.
==> NOW we only return a NACKINFO message and the mobile do not crash.
This commit is contained in:
parent
6df2768653
commit
eb233ff0a4
|
@ -47,7 +47,8 @@ From UDVM to UDVM
|
|||
int tcomp_udvm_bytecopy_self(tcomp_udvm_t *udvm, uint16_t *destination, uint16_t source, uint16_t size_tocopy)
|
||||
{
|
||||
uint16_t byte_copy_left, byte_copy_right;
|
||||
if (*destination == TCOMP_UDVM_GET_SIZE() || source == TCOMP_UDVM_GET_SIZE())
|
||||
//if (*destination == TCOMP_UDVM_GET_SIZE() || source == TCOMP_UDVM_GET_SIZE())
|
||||
if (*destination >= TCOMP_UDVM_GET_SIZE() || source >= TCOMP_UDVM_GET_SIZE())
|
||||
{
|
||||
/* SEGFAULT */
|
||||
tcomp_udvm_createNackInfo2(udvm, NACK_SEGFAULT);
|
||||
|
|
|
@ -109,7 +109,7 @@ uint16_t tcomp_udvm_opget_reference_param(tcomp_udvm_t *udvm)
|
|||
|
||||
case 0x80: // 10nnnnnn nnnnnnnn memory[2 * N] 0 - 65535
|
||||
{
|
||||
uint8_t N = (TSK_BINARY_GET_2BYTES(memory_ptr) & 0x3fff);
|
||||
uint16_t N = (TSK_BINARY_GET_2BYTES(memory_ptr) & 0x3fff);
|
||||
result = 2*N;
|
||||
udvm->executionPointer+=2;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue