Handle no comment end chars

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

View File

@ -636,6 +636,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),