set a more reasonable upper bound

This commit is contained in:
Richard Lyons 2025-05-10 20:20:12 +02:00
parent bb0d1b97f6
commit 89bd67a028

View file

@ -638,7 +638,7 @@ func SchemaToGrammar(schema []byte) []byte {
defer C.free(unsafe.Pointer(cStr))
// Allocate buffer for grammar based on schema length but with upper bound
maxLen := min(1024*1024*1024, len(schema)*4)
maxLen := min(1024*1024, len(schema)*4)
buf := make([]byte, maxLen)
// Call C function to convert schema to grammar