mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Fix overrun
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7772 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
15c7f7bf13
commit
b09654b1a4
1 changed files with 8 additions and 0 deletions
|
@ -561,6 +561,10 @@ getCString_c(ivars self, char *buffer, unsigned int maxLength,
|
|||
{
|
||||
int len;
|
||||
|
||||
if (maxLength > self->_count)
|
||||
{
|
||||
maxLength = self->_count;
|
||||
}
|
||||
if (maxLength < aRange.length)
|
||||
{
|
||||
len = maxLength;
|
||||
|
@ -590,6 +594,10 @@ getCString_u(ivars self, char *buffer, unsigned int maxLength,
|
|||
{
|
||||
int len;
|
||||
|
||||
if (maxLength > self->_count)
|
||||
{
|
||||
maxLength = self->_count;
|
||||
}
|
||||
if (maxLength < aRange.length)
|
||||
{
|
||||
len = maxLength;
|
||||
|
|
Loading…
Reference in a new issue