Uploaded image for project: 'MicroShift'
  1. MicroShift
  2. USHIFT-5904

USB ID like 0451 is interpreted as octal by config deserialization process breaking the GDP USB usage

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • None
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • 3
    • None
    • None
    • uShift Sprint 274
    • None
    • None
    • None

      Description of problem:

      Currently used yaml library uses Go's ParseInt and ParseUInt functions. Because 0451 has leading 0, it is being interpreted as octal and the value deserialized as 297 instead of (0)451.
      
      Value like 0781 is parsed correctly by accident: '8' is invalid in octal (0-7), so after Parse(U)Int fail, it's parsed by other function.

      Version-Release number of selected component (if applicable):

       

      How reproducible:

      100%

      Steps to Reproduce:

      1. Try use USB device with GDP that has one of the IDs starting with 0 and is valid octal number.
      

      Actual results:

      GDP looks for a different device

      Expected results:

      The number is deserialized correctly as hexdec despite leading 0.

      Additional info:

       

              pmatusza@redhat.com Patryk Matuszak
              pmatusza@redhat.com Patryk Matuszak
              None
              None
              Rama Kasturi Narra Rama Kasturi Narra
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: