Re: kubsan null pointer calculations

2022-01-20 Thread Todd C . Miller
On Thu, 20 Jan 2022 15:04:07 +0100, Alexander Bluhm wrote: > snprintf(9) allows NULL pointer if size is 0. But doing NULL pointer > arithmetic is undefined behavior. Check that size is positive > before doing that. While the use NUL char for string termination. > > Pfkey import_flow() must do t

kubsan null pointer calculations

2022-01-20 Thread Alexander Bluhm
Hi, snprintf(9) allows NULL pointer if size is 0. But doing NULL pointer arithmetic is undefined behavior. Check that size is positive before doing that. While the use NUL char for string termination. Pfkey import_flow() must do the NULL check before doing pointer calculations. ok? bluhm In