mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-05 20:17:43 +00:00
Fix 'radiff2 -g' crash
No all users of r_diff_buffers_distance() pass a pointer for 'distance' argument. Check for NULL before assigning a value to it. Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
This commit is contained in:
parent
1fc7dd4cf6
commit
f1a9852362
@ -199,8 +199,10 @@ R_API int r_diff_buffers_distance(RDiff *d, const ut8 *a, ut32 la, const ut8 *b,
|
||||
return R_FALSE;
|
||||
|
||||
if (la == lb && !memcmp (a, b, la)) {
|
||||
*distance = 0;
|
||||
*similarity = 1.0;
|
||||
if (distance != NULL)
|
||||
*distance = 0;
|
||||
if (similarity != NULL)
|
||||
*similarity = 1.0;
|
||||
return R_TRUE;
|
||||
}
|
||||
totalsz = sizeof(int*) * (lb+1);
|
||||
|
Loading…
Reference in New Issue
Block a user