Hi Chinmay,

Actually calling memcpy with NULL as parameters can lead to undefined
behavior, so scan-build is showing that warning.
There is already a patch regarding the same on Gerrit:
https://review.coreboot.org/c/flashrom/+/62726

Aarya.

On Sat, May 7, 2022 at 5:01 PM Chinmay Lonkar <[email protected]>
wrote:

> Hi,
> I'm trying to fix the build errors of flashrom and came across an API
> error
> "Argument with 'nonnull' attribute passed null" which occurred in memcpy()
> function called inside sp_stream_buffer_op() in file serprog.c.
>
> We are passing the third argument of sp_stream_buffer_op() as NULL which
> gets passed on to the second argument of memcpy() and it expects that
> argument to be nonnull.
>
> Can anybody please provide me with the info and docs for knowing exactly
> what sp_stream_buffer_op() function does?
>
> Also, should we report an error when the third argument passed in the
> sp_stream_buffer_op() is NULL?
>
> Thank You!
>
> Regards,
> Chinmay Lonkar
> _______________________________________________
> flashrom mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
>
_______________________________________________
flashrom mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to