On 3/7/24 16:01, Ales Musil wrote:
> The new_buffer data pointer is NULL when the size of the cloned
> buffer is 0. This is fine as there is no need to allocate space.
> However, the cloned buffer header/msg might be the same pointer
> as data. This causes undefined behavior by adding 0 to NULL
Bleep bloop. Greetings Ales Musil, I am a robot and I have tried out your
patch.
Thanks for your contribution.
I encountered some error that I wasn't expecting. See the details below.
checkpatch:
WARNING: The subject summary should end with a dot.
Subject: ofpbuf: Prevent undefined behavior
The new_buffer data pointer is NULL when the size of the cloned
buffer is 0. This is fine as there is no need to allocate space.
However, the cloned buffer header/msg might be the same pointer
as data. This causes undefined behavior by adding 0 to NULL pointer.
Check if the data buffer is not NULL