Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-1558

panic after failed unmarshal in GetDeepMutableBody

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 3.0
    • None
    • SyncGateway
    • Security Level: Public
    • None
    • CBG Sprint 79
    • 5

    Description

      In 2.8.0, GetDeepMutableBody logs a warning and returns nil if it's passed malformed JSON. If callers aren't checking for this case, subsequent code may panic on a nil Body.

      There's been at least one reported case of this, but it's unclear whether the GetDeepMutableBody invocation is the one in documentUpdateFunc or resolveConflict.

      Both should be tested with malformed JSON. In the case of documentUpdateFunc, the rev should be rejected, instead of a panic being caught by the recover in blip_sync_context. For conflict resolver, should return as resolveError.

      Attachments

        Activity

          People

            isaac.lambat Isaac Lambat
            adamf Adam Fraser
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty