File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ template <> struct string_traits<pgvector::Vector> {
3131 static constexpr bool converts_from_string{true };
3232
3333 static pgvector::Vector from_string (std::string_view text) {
34- if (text.front () != ' [' || text.back () != ' ]' ) {
34+ if (text.size () < 2 || text. front () != ' [' || text.back () != ' ]' ) {
3535 throw conversion_error (" Malformed vector literal" );
3636 }
3737
@@ -76,7 +76,7 @@ template <> struct string_traits<pgvector::HalfVector> {
7676 static constexpr bool converts_from_string{true };
7777
7878 static pgvector::HalfVector from_string (std::string_view text) {
79- if (text.front () != ' [' || text.back () != ' ]' ) {
79+ if (text.size () < 2 || text. front () != ' [' || text.back () != ' ]' ) {
8080 throw conversion_error (" Malformed halfvec literal" );
8181 }
8282
You can’t perform that action at this time.
0 commit comments