Decode struct infinite recursion with mgocompat Registry

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 1.3.1
    • Affects Version/s: 1.3.0
    • Component/s: BSON, mgobson
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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 (Inactive)
              Reporter:
              James Kingston
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: