Fix potential buffer overflow in rc2 (#1792)
This commit is contained in:
parent
978ecd903e
commit
23baf7b5f6
1 changed files with 2 additions and 2 deletions
|
|
@ -188,8 +188,8 @@ static void rc2_crypt(struct rc2_state *state, const ut8 *inbuf, ut8 *outbuf, in
|
|||
}
|
||||
}
|
||||
|
||||
if (idx % 8) {
|
||||
while (idx % 8) {
|
||||
if (idx % 8 && idx < BLOCK_SIZE) {
|
||||
while (idx % 8 && idx < BLOCK_SIZE) {
|
||||
data_block[idx++] = 0;
|
||||
}
|
||||
rc2_crypt8(state, (const ut8 *)data_block, (ut8 *)crypted_block);
|
||||
|
|
|
|||
Loading…
Reference in a new issue