Uploaded image for project: 'VOLTHA'
  1. VOLTHA
  2. VOL-1952

affinityrouter will panic if field not found in decodeProtoField

    XMLWordPrintable

    Details

      Description

      In affinity router unit test,

      s, err = aRouter.decodeProtoField(portData, 5) // field 5 is AdminState

      Will cause a panic if the admin_state field was not set:

      {"level":"debug","ts":"2019-09-23T10:35:07.812-0700","msg":"Decoding afinity value attributeNumber: 5 from [8 123 18 9 116 101 115 116 108 97 98 101 108 24 3 58 4 53 54 55 56 73 148 38 0 0 0 0 0 0] at index 30","caller":"affinity-router.decodeProtoField:233"}
      --- FAIL: TestAffinityRouterDecodeProtoField (0.02s)
      panic: runtime error: index out of range [recovered]
              panic: runtime error: index out of range

      Return a suitable error instead.

        Attachments

        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            scottb Scott Baker
            Reporter:
            scottb Scott Baker
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes