mirror of
https://github.com/gnustep/libs-sqlclient.git
synced 2025-06-04 19:11:13 +00:00
Fix buffer overrun
This commit is contained in:
parent
9f90bdc755
commit
db1ff663f6
1 changed files with 3 additions and 2 deletions
|
@ -3256,6 +3256,7 @@ static int poolConnections = 0;
|
||||||
unsigned char *buf;
|
unsigned char *buf;
|
||||||
unsigned char *ptr;
|
unsigned char *ptr;
|
||||||
const unsigned char *from = (const unsigned char*)statement;
|
const unsigned char *from = (const unsigned char*)statement;
|
||||||
|
const unsigned char *end = from + strlen((const char*)statement);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calculate length of buffer needed.
|
* Calculate length of buffer needed.
|
||||||
|
@ -3274,10 +3275,10 @@ static int poolConnections = 0;
|
||||||
* Merge quoted data objects into statement.
|
* Merge quoted data objects into statement.
|
||||||
*/
|
*/
|
||||||
i = 1;
|
i = 1;
|
||||||
from = (unsigned char*)statement;
|
while (from < end)
|
||||||
while (*from != 0)
|
|
||||||
{
|
{
|
||||||
if (*from == *(unsigned char*)marker
|
if (*from == *(unsigned char*)marker
|
||||||
|
&& (from + mLength) < end
|
||||||
&& memcmp(from, marker, mLength) == 0)
|
&& memcmp(from, marker, mLength) == 0)
|
||||||
{
|
{
|
||||||
NSData *d = [blobs objectAtIndex: i++];
|
NSData *d = [blobs objectAtIndex: i++];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue