Fixed segmentation fault with text representation

This commit is contained in:
Andrew Kane
2023-06-12 01:09:40 -07:00
parent e5a620e02c
commit 06c3e68bef
4 changed files with 14 additions and 1 deletions

View File

@@ -194,7 +194,7 @@ vector_in(PG_FUNCTION_ARGS)
pt = strtok(NULL, ",");
}
if (*stringEnd != ']')
if (stringEnd == NULL || *stringEnd != ']')
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("malformed vector literal: \"%s\"", lit),