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
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 chinmay20220@gmail.com 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 -- flashrom@flashrom.org To unsubscribe send an email to flashrom-leave@flashrom.org
Thanks, I'll check it out.
On Sat, 7 May 2022, 17:51 Aarya Chaumal, aarya.chaumal@gmail.com wrote:
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 chinmay20220@gmail.com 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 -- flashrom@flashrom.org To unsubscribe send an email to flashrom-leave@flashrom.org