Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1488

Decode struct infinite recursion with mgocompat Registry

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 1.3.1
    • 1.3.0
    • BSON, mgobson
    • None

    Description

      main.go

       

      The attached program triggers the issue.  It would seem to be a missing nil check somewhere in this call:

      if sc.DecodeDeepZeroInline && sd.inline

      { val.Set(deepZero(val.Type())) }

      at go.mongodb.org/mongo-driver@v1.3.0/bson/bsoncodec/struct_codec.go:198

      Removing the draft field bypasses the issue.  Replacing the embedded Common struct with the ID field also bypasses the issue, so there is something in the intersection of those two fields.

      Attachments

        1. main.go
          0.9 kB

        Activity

          People

            isabella.siu@mongodb.com Isabella Siu (Inactive)
            jkingston@istreamplanet.com James Kingston
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: