mirror of
https://github.com/radareorg/radare2.git
synced 2024-10-07 10:33:30 +00:00
Fix uaf in r_asm_op_get_hex ##crash
This commit is contained in:
parent
08e51ab484
commit
e3d0768453
@ -29,8 +29,16 @@ R_DEPRECATE R_API void r_asm_op_fini(RAnalOp *op) {
|
||||
R_API char *r_asm_op_get_hex(RAnalOp *op) {
|
||||
r_return_val_if_fail (op && op->bytes, NULL);
|
||||
const int size = op->size;
|
||||
if (size < 1) {
|
||||
return NULL;
|
||||
}
|
||||
char* str = calloc (size + 1, 2);
|
||||
r_hex_bin2str (op->bytes, size, str);
|
||||
if (str) {
|
||||
int res = r_hex_bin2str (op->bytes, size, str);
|
||||
if (res < 1) {
|
||||
R_FREE (str);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user