Subject: Re: bug#30785: Man pages truncated, repeated

From: Danny Milosavljevic <[email-masked]>
Date: Mon, 14 Jan 2019 18:50:54 +0100

On Mon, 14 Jan 2019 18:48:53 +0100
Danny Milosavljevic <[email-masked]> wrote:

> set_current_prefix() searches for the current program executable file in $PATH,
> and it can fail and return 0. 
> 
> In that case, relocatep will probably segfault at the location marked below:
> 
> >   char *relocated_path = new char[curr_prefix_len + relative_path_len + 1];
> >   strcpy(relocated_path, curr_prefix);  
>                            ^^^^^^^^^^^

This probably happens when argv[0] is not an absolute path, but still the program
somehow got started, but it is not found in $PATH either.