Re: [pacman-dev] [PATCH v2] pacman: fix possible buffer overflow

2018-10-16 Thread Andrew Gregory
On 09/22/18 at 11:30pm, morganamilo wrote: > in the function query_fileowner, if the user enters a string longer > than PATH_MAX then rpath will buffer overflow when lrealpath tries to > strcat everything together. > > So make sure to bail early if the generated path is going to be bigger > than

[pacman-dev] [PATCH v2] pacman: fix possible buffer overflow

2018-09-22 Thread morganamilo
in the function query_fileowner, if the user enters a string longer than PATH_MAX then rpath will buffer overflow when lrealpath tries to strcat everything together. So make sure to bail early if the generated path is going to be bigger than PATH_MAX. This also fixes the compiler warning: