VictorTennekes/get_next_line

Malloc fail will result in SEGSEV

harm-smits opened this issue · 0 comments

On get_next_line.c line 66, you allocate an empty string. If the malloc fails, you then call ft_strchr on the empty string you allocated. Since you don't check whether the string is valid in ft_strchr, you will try and access the index of a NULL pointer, thus causing a segmentation fault.

res = ft_strdup("");