miguelfreitas / twister-seeder

twister dns seeder
51 stars 25 forks source link

fix segmentation fault #9

Closed dryabov closed 3 years ago

dryabov commented 3 years ago

This PR fixes two issues found:

  1. Missed return statement (debugging showed that currently g++ with optimization level -O1 or higher doesn't insert return automatically, and execution enters another function with garbage in the stack).
  2. Possible access to the element of empty array (ourId[0]).
dryabov commented 3 years ago

As to the missed return, maybe it's something specific to pthread, but in gdb the execution jumps from ThreadDNS to ThreadSeeder without returning to the caller.

ghost commented 3 years ago

https://github.com/miguelfreitas/twister-seeder/issues/6#issuecomment-799544232