Skip to content

Possible error in test202, both endians, in second segment header block #2

@darrellroot

Description

@darrellroot

I think you have an error in the second segment header block in difficult test202 with the fourth option (291?) starting at byte 126 which has a length 0.

Not only does my parser crash on it, wireshark crashes on it!

Here's each octet of the test202 little endian segment header with a manual decode.

(lldb) po data[0 ..< 50]
▿ 50 bytes
  - count : 50
  ▿ pointer : 0x0000000102824000
    - pointerValue : 4337057792
  ▿ bytes : 50 elements
    - 0 : 10    block type SHB
    - 1 : 13
    - 2 : 13
    - 3 : 10
    - 4 : 0    block total length 124
    - 5 : 0
    - 6 : 0
    - 7 : 124     
    - 8 : 26     byte order magic (little endian)
    - 9 : 43
    - 10 : 60
    - 11 : 77
    - 12 : 0      major version 1
    - 13 : 1
    - 14 : 0      minor version 0
    - 15 : 0
    - 16 : 255    section length -1
    - 17 : 255
    - 18 : 255
    - 19 : 255
    - 20 : 255
    - 21 : 255
    - 22 : 255
    - 23 : 255
    - 24 : 0       first option 2 (hardware)
    - 25 : 2
    - 26 : 0        first option length 9 + 3 padding
    - 27 : 9
    - 28 : 65       start of first option value
    - 29 : 112
    - 30 : 112
    - 31 : 108
    - 32 : 101
    - 33 : 32
    - 34 : 77
    - 35 : 66
    - 36 : 80        end of first option value
    - 37 : 0         
    - 38 : 0       
    - 39 : 0         end of first option padding
    - 40 : 0         second option 3 (shb_os)
    - 41 : 3
    - 42 : 0         second option length 12 + 0 padding
    - 43 : 12        
    - 44 : 79        start of second option value
    - 45 : 83
    - 46 : 45
    - 47 : 88
    - 48 : 32
    - 49 : 49


(lldb) po data[50 ..< 100]
▿ 50 bytes
  - count : 50
  ▿ pointer : 0x0000000102824032
    - pointerValue : 4337057842
  ▿ bytes : 50 elements
    - 0 : 48
    - 1 : 46
    - 2 : 49
    - 3 : 48
    - 4 : 46
    - 5 : 53        end of second option value (no padding)
    - 6 : 0        third option 4 (shb_userappl)
    - 7 : 4
    - 8 : 0        third option length 15 + 1 padding
    - 9 : 15
    - 10 : 112      start of third option value
    - 11 : 99
    - 12 : 97
    - 13 : 112
    - 14 : 95
    - 15 : 119
    - 16 : 114
    - 17 : 105
    - 18 : 116
    - 19 : 101
    - 20 : 114
    - 21 : 46
    - 22 : 108
    - 23 : 117
    - 24 : 97          end of third option value
    - 25 : 0           third option padding
    - 26 : 1           fourth option 291 (what?)
    - 27 : 35
    - 28 : 0           fourth option length 0
    - 29 : 0
    - 30 : 129         now my decoder is totally confused
    - 31 : 35
    - 32 : 0
    - 33 : 11
    - 34 : 116
    - 35 : 101
    - 36 : 115
    - 37 : 116
    - 38 : 50
    - 39 : 48
    - 40 : 50
    - 41 : 32
    - 42 : 78
    - 43 : 82
    - 44 : 66
    - 45 : 0
    - 46 : 0
    - 47 : 1
    - 48 : 0
    - 49 : 13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions