ayush00git opened a new issue, #3619:
URL: https://github.com/apache/fory/issues/3619

   ### Search before asking
   
   - [x] I had searched in the [issues](https://github.com/apache/fory/issues) 
and found no similar issues.
   
   
   ### Version
   
   v0.17.0
   
   ### Component(s)
   
   Go
   
   ### Minimal reproduce step
   
   ```go
   func TestTypeDefFieldCountOOMPanic(t *testing.T) {
        fory := NewFory()
        header := int64(HAS_FIELDS_META_FLAG | 8)
   
        // metaHeaderByte value of 31 triggers the extended VarUint32 
field-count path.
        buffer := NewByteBuffer(make([]byte, 0, 8))
        buffer.WriteByte(31)
        buffer.WriteVarUint32(2000000000)
        buffer.WriteUint8(0)
        buffer.WriteVarUint32(0)
        buffer.SetReaderIndex(0)
   
        _, err := decodeTypeDef(fory, buffer, header)
        if err == nil {
                t.Fatal("expected error for oversized fieldCount, got nil")
        }
   }
   
   func TestTypeDefNestedRecursionStackOverflowPanic(t *testing.T) {
        depth := 20000000
        buffer := NewByteBuffer(make([]byte, 0, depth*2))
        for i := 0; i < depth; i++ {
                buffer.WriteVarUint32Small7(uint32(LIST) << 2)
        }
        buffer.WriteVarUint32Small7(uint32(INT32) << 2)
        buffer.SetReaderIndex(0)
   
        bufErr := &Error{}
        _, err := readFieldTypeWithFlags(buffer, 0, bufErr)
        if err == nil {
                t.Fatal("expected error for excessive nesting depth, got nil")
        }
   }
   ```
   
   ### What did you expect to see?
   
   j
   
   ### What did you see instead?
   
   .
   
   ### Anything Else?
   
   /
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to