added securities for segfaults

Signed-off-by: Lasconik <caillouxnicolas@gmail.com>