mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-13 19:52:20 +00:00
tt_isam_record.C: fix CERT VU#387387 part 2
This commit is contained in:
parent
e820f21540
commit
95e6fd42cc
1 changed files with 14 additions and 1 deletions
|
@ -159,5 +159,18 @@ void _Tt_isam_record::setBytes (int start,
|
|||
int length,
|
||||
const _Tt_string &value)
|
||||
{
|
||||
(void)memcpy((char *)buffer+start, (char *)value, length);
|
||||
// JET - CERT vulnerability: VU#387387 - value is user supplied.
|
||||
// Geez.
|
||||
int bavail = (maxLength - start);
|
||||
int bcp = 0;
|
||||
|
||||
if (bavail <= 0)
|
||||
return;
|
||||
|
||||
if (bavail > length)
|
||||
bcp = length;
|
||||
else
|
||||
bcp = bavail;
|
||||
|
||||
(void)memcpy((char *)buffer+start, (char *)value, bcp);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue