Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: talitos - fix bug in sg_copy_end_to_buffer
This commit is contained in:
Коммит
38ea6e62d3
|
@ -1183,10 +1183,14 @@ static size_t sg_copy_end_to_buffer(struct scatterlist *sgl, unsigned int nents,
|
||||||
/* Copy part of this segment */
|
/* Copy part of this segment */
|
||||||
ignore = skip - offset;
|
ignore = skip - offset;
|
||||||
len = miter.length - ignore;
|
len = miter.length - ignore;
|
||||||
|
if (boffset + len > buflen)
|
||||||
|
len = buflen - boffset;
|
||||||
memcpy(buf + boffset, miter.addr + ignore, len);
|
memcpy(buf + boffset, miter.addr + ignore, len);
|
||||||
} else {
|
} else {
|
||||||
/* Copy all of this segment */
|
/* Copy all of this segment (up to buflen) */
|
||||||
len = miter.length;
|
len = miter.length;
|
||||||
|
if (boffset + len > buflen)
|
||||||
|
len = buflen - boffset;
|
||||||
memcpy(buf + boffset, miter.addr, len);
|
memcpy(buf + boffset, miter.addr, len);
|
||||||
}
|
}
|
||||||
boffset += len;
|
boffset += len;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче