pellegre / libcrafter

A high level C++ network packet sniffing and crafting library.
298 stars 88 forks source link

Segmentation fault with DNS response parser #48

Closed pavel-odintsov closed 8 years ago

pavel-odintsov commented 8 years ago

Hello!

I'm getting segmentation faults with DNS response reader:

Program received signal SIGSEGV, Segmentation fault.
Crafter::Layer::Print (this=0x0, str=...) at crafter/Layer.cpp:210
210     str << name << " (" << dec << GetSize() << " bytes) " << ":: ";
(gdb) quit

Do you have some idea how to fix it?

Thanks!

pellegre commented 8 years ago

it looks like you are calling the Print method on a NULL object? can you please share the full code you are trying to execute?

pavel-odintsov commented 8 years ago

I've used example dns client from libcrafter repo.

On Thursday, 7 July 2016, Esteban Pellegrino notifications@github.com wrote:

it looks like you are calling the Print method on a NULL object? can you please share the full code you are trying to execute?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pellegre/libcrafter/issues/48#issuecomment-231139016, or mute the thread https://github.com/notifications/unsubscribe/ACnfZoS2vLo8PuHYmI2QLafDRJJn5tL5ks5qTS55gaJpZM4JG0qG .

Sincerely yours, Pavel Odintsov

oliviertilmans commented 8 years ago

Hi Pavel,

I assume you meant this example: https://github.com/pellegre/libcrafter-examples/blob/master/DNSQuery/main.cpp ?

Before anything else, did you check that:

In my case, simply doing s/wlan0/wlp2s0 s/192.168.0.1/8.8.8.8 did the trick.

The example could use some help and check that the dns_layer is not NULL ...

pavel-odintsov commented 8 years ago

Hello!

Thanks for answer! Looks like it was my bug :( I've tried to reproduce it but it's woking like a charm! ;)