8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 09:23:03 +01:00

Adriano found a case where I didn't check for a premature, unexpected null terminator.

I found another case, too.
This commit is contained in:
robocop 2006-12-31 09:19:46 +00:00
parent 40fd6f9766
commit b106f0bffc

View File

@ -3067,7 +3067,9 @@ static processing_state create_db(const TEXT* statement,
while (*comment && *comment != '\n')
++comment;
++comment; // skip the newline
if (*comment == '\n')
++comment; // skip the newline
while (*comment && fb_isspace(*comment))
++comment;
}
@ -3106,12 +3108,16 @@ static processing_state create_db(const TEXT* statement,
{
for (const char& newquote = *comment++; *comment; ++comment)
{
// If we find 'hello ''world''' this is valid.
if (*comment != newquote)
continue;
// If we find 'hello ''world''' this is valid.
if (comment[1] == newquote)
{
comment += 2;
if (!*comment)
break;
}
if (*comment == newquote && comment[1] != newquote)
{