Ask Your Question
0

LUA script add item to end of data gives stack overflow

asked 2022-10-06 15:07:48 +0000

IanW gravatar image

I'm writing my first dissector, so have a noob question, I'm afraid.

How do I add an item from a fixed offset to the end of the data. According to the docs -1 is mean to do this, as in:

local t_body = t_pao:add(buffer(35,-1), "Body")

but when I try that, or range(), I get:

Lua Error: ...ds\WiresharkPortable64-development\Data\plugins\pao.lua:43: C stack overflow
edit retag flag offensive close merge delete

Comments

Is this a TreeItem ':add`?

Chuckc gravatar imageChuckc ( 2022-10-06 15:39:48 +0000 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-10-06 15:57:07 +0000

cmaynard gravatar image

What if you try this instead:

local t_body = t_pao:add(buffer(35), "Body")
edit flag offensive delete link more

Comments

Well, that's odd. I'm sure I'd tried that too, but retesting proves me a liar.

Many thanks!

i

IanW gravatar imageIanW ( 2022-10-06 17:02:23 +0000 )edit

buffer(35,-1) and buffer(35) should give the exact same result, and it does for me. Are you able to add back the -1 and test this again? Did you do any other changes as well?

Stig gravatar imageStig ( 2022-10-08 21:10:15 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-10-06 15:07:48 +0000

Seen: 166 times

Last updated: Oct 06 '22