I got a bazillion of these (for an extremely common pattern in many projects):
memset(alarmObjects, 0, sizeof(alarmObjects));
(error) Buffer read/write, when calling 'memset' it cannot be determined that 1st argument is not overflowed [bughuntingBufferOverflow]
HTH! Best Regards, Dave
-- Dave Nadler, USA East Coast voice (978) 263-0097, drn@nadler.com, Skype Dave.Nadler1
I thought it might suffer from some strange declaration, but I can confirm it for
int alarmObjects[42]; void foo() { memset(alarmObjects, 0, sizeof(alarmObjects)); }
as well. I've created https://trac.cppcheck.net/ticket/10250 therefore.
Thanks Alexander! Very nice '42' ;-)
Log in to post a comment.
I got a bazillion of these (for an extremely common pattern in many
projects):
memset(alarmObjects, 0, sizeof(alarmObjects));
(error) Buffer read/write, when calling 'memset' it cannot be determined
that 1st argument is not overflowed [bughuntingBufferOverflow]
HTH!
Best Regards, Dave
--
Dave Nadler, USA East Coast voice (978) 263-0097, drn@nadler.com, Skype
Dave.Nadler1
I thought it might suffer from some strange declaration, but I can confirm it for
as well.
I've created https://trac.cppcheck.net/ticket/10250 therefore.
Thanks Alexander! Very nice '42' ;-)