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

Decode struct infinite recursion with mgocompat Registry

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.3.0
    • Fix Version/s: 1.3.1
    • Component/s: BSON, mgobson
    • Labels:
      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

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

              Dates

              Created:
              Updated:
              Resolved: