Handle no comment end chars

pull/6763/head^2
Gokhan Gulbiz 2023-03-20 08:46:52 +03:00
parent fc23fd5061
commit 8b09a4f8c0
No known key found for this signature in database
GPG Key ID: 608EF06B6BD1B45B
1 changed files with 7 additions and 0 deletions

View File

@ -706,6 +706,13 @@ ExtractTopComment(const char *inputString)
commentEndCharsIndex++; commentEndCharsIndex++;
} }
/* If there is no end of comment chars , return NULL */
if (inputString[commentEndCharsIndex] != '*' &&
inputString[commentEndCharsIndex + 1] != '/')
{
return NULL;
}
if (commentEndCharsIndex > commentStartCharsLength) if (commentEndCharsIndex > commentStartCharsLength)
{ {
Datum substringTextDatum = DirectFunctionCall3(text_substr, PointerGetDatum(inputString), Datum substringTextDatum = DirectFunctionCall3(text_substr, PointerGetDatum(inputString),