Skip to content

This fixes a segmentation fault if the pcap is too small.#225

Open
sn0cr wants to merge 1 commit into
emmericp:masterfrom
sn0cr:fix-replay-pcap
Open

This fixes a segmentation fault if the pcap is too small.#225
sn0cr wants to merge 1 commit into
emmericp:masterfrom
sn0cr:fix-replay-pcap

Conversation

@sn0cr

@sn0cr sn0cr commented Aug 17, 2018

Copy link
Copy Markdown

Hi @emmericp,

during my testing with small pcaps (containing only the TCP handshake) I found that the replay-pcap example crashes Moongen with a SegFault. With this change this should not happen (at least this is the simplest change to mitigate it)

The buffer is nil if the pcap file was already fully replayed.
Thus the moongen script crashes if it is not a multiple of the
buffers in size. With this commit this should be fixed.
@emmericp

Copy link
Copy Markdown
Owner

Hmm, the root cause of this is something else; __ipairs shouldn't return nil buffers.

@emmericp

Copy link
Copy Markdown
Owner

Can you send me an example pcap to reproduce this? Or put it in your home directory on one of the persistent servers

@holzingk

holzingk commented Apr 4, 2019

Copy link
Copy Markdown
Contributor

Possibly related #240

@shuwens

shuwens commented Jul 1, 2019

Copy link
Copy Markdown

I can confirm that this patch/PR is required for replaying a pcap trace in rate limiting mode to work. Not sure about the size part tho. The trace I am using is 100M.

@holzingk

Copy link
Copy Markdown
Contributor

I sent @emmericp an example pcap via email. Hope it gets fixed soon.

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

Successfully merging this pull request may close these issues.

4 participants