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

Decode struct infinite recursion with mgocompat Registry

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.3.1
    • Affects Version/s: 1.3.0
    • Component/s: BSON, mgobson
    • None

      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.

        1. main.go
          0.9 kB

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

              Created:
              Updated:
              Resolved: