Bug 10216

Summary: package/x11r7/mcookie/mcookie.c:207: bad size ?
Product: buildroot Reporter: David Binderman <dcb314>
Component: OtherAssignee: Bernd Kuhls <bernd>
Status: RESOLVED FIXED    
Severity: minor CC: buildroot
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description David Binderman 2017-08-09 20:26:15 UTC
buildroot-2017.08-rc1/package/x11r7/mcookie/mcookie.c:207]: (warning) Size of pointer 'ctx' used instead of size of its data.

Source code is

    memset(ctx, 0, sizeof(ctx));    /* In case it's sensitive */

Maybe better code

    memset(ctx, 0, sizeof(*ctx));    /* In case it's sensitive */
Comment 1 Bernd Kuhls 2017-09-25 19:03:16 UTC
Thanks to your bug report I noticed that mcookie is part of util-linux:
https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/misc-utils

Therefore I plan to submit a patch to buildroot that removes the mcookie package in favour of util-linux which actively maintains mcookie:
https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/log/misc-utils/mcookie.c

If your bug report is still valid with upstream then please send your bug report to https://github.com/karelzak/util-linux
Comment 2 Peter Korsgaard 2017-09-26 10:36:41 UTC
FYI, this specific issue was fixed upstream (util-linux) back in 2009:

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

I'll fix up our embedded mcookie.c copy as well for 2017.02.7 and 2017.08.1. Moving forward, it indeed makes more sense to use the util-linux version.
Comment 3 Thomas Petazzoni 2018-01-10 21:30:36 UTC
(In reply to Bernd Kuhls from comment #1)
Bernd, did you ever got around to submitting the patch removing the mcookie package, and switching to the one from util-linux instead?