[Buildroot] [PATCH] mcookie: correct wrong memset argument

Peter Korsgaard peter at korsgaard.com
Fri Jan 12 18:57:09 UTC 2018


>>>>> "Peter" == Peter Korsgaard <peter at korsgaard.com> writes:

 > Fixes #10216
 > Building mcookie generates a warning about possible wrong arguments to
 > memset:

 > mcookie.c:207:26: warning: argument to ‘sizeof’ in ‘memset’ call is the same expression
 >   as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess]
 >      memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */

 > ctx is a pointer to a structure, so the code should use the size of the
 > structure and not the size of the pointer when it tries to clear the
 > structure, similar to how it got fixed upstream back in 2009:

 > https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/lib/md5.c?id=6596057175c6ed342dc20e85eae8a42eb29b629f

 > Signed-off-by: Peter Korsgaard <peter at korsgaard.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard


More information about the buildroot mailing list