Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capnp.lua: 111: Range is out of bounds #4

Open
koolkhel opened this issue Dec 12, 2017 · 3 comments
Open

capnp.lua: 111: Range is out of bounds #4

koolkhel opened this issue Dec 12, 2017 · 3 comments

Comments

@koolkhel
Copy link

Frame 992: 146 bytes on wire (1168 bits), 146 bytes captured (1168 bits) on interface 0
Ethernet II, Src: Tp-LinkT_00:8d:26 (ec:08:6b:00:8d:26), Dst: Apple_7a:3a:bd (ac:bc:32:7a:3a:bd)
Internet Protocol Version 4, Src: xx.xx.xx.xx, Dst: xx.xx.xx.xx
Transmission Control Protocol, Src Port: xxxx, Dst Port: 58047, Seq: 185, Ack: 481, Len: 80
Cap'n Proto RPC Protocol
    Segments: 1
Lua Error: [string "~/.wireshark/plugins/capnp.lua..."]:110: Range is out of bounds
    [Expert Info (Error/Undecoded): Lua Error: [string "~/.wireshark/plugins/capnp.lua..."]:110: Range is out of bounds]
        [Lua Error: [string "~/.wireshark/plugins/capnp.lua..."]:110: Range is out of bounds]
        [Severity level: Error]
        [Group: Undecoded]

Hello! I'm trying to parse a custom Cap'N Proto protocol on the wire. I have compiled schemas with Makefile to lua scripts, they seem to be complete and valid. Yet, I get this message when I try to run Wireshark. Messages go on TCP stream with self-delimiting of Cap'N Proto. Any ideas on how to debug this?

@koolkhel koolkhel changed the title Frame 992: 146 bytes on wire (1168 bits), 146 bytes captured (1168 bits) on interface 0 Ethernet II, Src: Tp-LinkT_00:8d:26 (ec:08:6b:00:8d:26), Dst: Apple_7a:3a:bd (ac:bc:32:7a:3a:bd) Internet Protocol Version 4, Src: 178.76.194.26, Dst: 172.26.6.16 Transmission Control Protocol, Src Port: 6666, Dst Port: 58047, Seq: 185, Ack: 481, Len: 80 Cap'n Proto RPC Protocol Segments: 1 Lua Error: [string "/Users/bitterman/.wireshark/plugins/capnp.lua..."]:110: Range is out of bounds [Expert Info (Error/Undecoded): Lua Error: [string "/Users/bitterman/.wireshark/plugins/capnp.lua..."]:110: Range is out of bounds] [Lua Error: [string "~/plugins/capnp.lua..."]:110: Range is out of bounds] capnp.lua: 111: Range is out of bounds Dec 12, 2017
@koolkhel
Copy link
Author

It seems like 'size' around those lines sometimes gets to 524304 for my case:

 -- decode segments header
   for i = 1, count do
      local b_size = buf(4 * i, 4)
      local size = b_size:le_uint() * 8
      print(size, count, i)
      segs[i - 1] = data(0, size):tvb()
      seg_tree
         :add(b_size, "Segment:", i - 1, "(", size / 8, "words )")
         :add(data(0, size), "Data (", size, "bytes )")
      data = data(size):tvb()
   end

@MTRNord
Copy link

MTRNord commented Mar 16, 2024

I am seeing similar bugs now around the seg_table_size variable. :/ Any ideas?

@MTRNord
Copy link

MTRNord commented Mar 16, 2024

Ok this seems like its related to packed streams. Using the unpacked version makes it all work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants