mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix possible buffer overflow in selection code. We want to copy the
number of selected data since the offset, not the offset!
This commit is contained in:
parent
e422e56db0
commit
3906782406
1 changed files with 2 additions and 2 deletions
|
|
@ -1181,14 +1181,14 @@ static short selectbuffer_ret_hits_15(unsigned int *UNUSED(buffer), const short
|
|||
static short selectbuffer_ret_hits_9(unsigned int *buffer, const short hits15, const short hits9)
|
||||
{
|
||||
const int offs = 4 * hits15;
|
||||
memcpy(buffer, buffer + offs, 4 * offs);
|
||||
memcpy(buffer, buffer + offs, 4 * hits9);
|
||||
return hits9;
|
||||
}
|
||||
|
||||
static short selectbuffer_ret_hits_5(unsigned int *buffer, const short hits15, const short hits9, const short hits5)
|
||||
{
|
||||
const int offs = 4 * hits15 + 4 * hits9;
|
||||
memcpy(buffer, buffer + offs, 4 * offs);
|
||||
memcpy(buffer, buffer + offs, 4 * hits5);
|
||||
return hits5;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue