lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 18 Oct 2017 11:07:35 +0000
From:   <Alexander.Steffen@...ineon.com>
To:     <joe@...ches.com>, <julia.lawall@...6.fr>
CC:     <elfring@...rs.sourceforge.net>, <linux-integrity@...r.kernel.org>,
        <linuxppc-dev@...ts.ozlabs.org>,
        <James.Bottomley@...senPartnership.com>,
        <dan.carpenter@...cle.com>, <jarkko.sakkinen@...ux.intel.com>,
        <andriy.shevchenko@...ux.intel.com>, <benh@...nel.crashing.org>,
        <clabbe.montjoie@...il.com>, <jgunthorpe@...idianresearch.com>,
        <jsnitsel@...hat.com>, <kgold@...ux.vnet.ibm.com>,
        <mpe@...erman.id.au>, <nayna@...ux.vnet.ibm.com>,
        <paulus@...ba.org>, <PeterHuewe@....de>,
        <stefanb@...ux.vnet.ibm.com>, <linux-kernel@...r.kernel.org>,
        <kernel-janitors@...r.kernel.org>
Subject: RE: char-TPM: Adjustments for ten function implementations

> On Wed, 2017-10-18 at 10:44 +0000, Alexander.Steffen@...ineon.com wrote:
> > > For instance, nothing about
> > > > > 	sizeof(type)
> > > > > vs
> > > > > 	sizeof(*ptr)
> > > > > makes it easier for a human to read the code.
> > > >
> > > > If it does not make it easier to read the code for you, then maybe you
> > > > should consider that this might not be true for all humans. For me, it
> > > > makes it much easier to see at a glance, that code like
> > > > ptr=malloc(sizeof(*ptr)) is correct.
> > >
> > > I don't think there is a perfect solution.
> >
> > Maybe. But for the second variant the correctness is easier to check,
> 
> How often should
> 	ptr = alloc(sizeof(*ptr))
> be
> 	ptr = alloc(sizeof(**ptr))

Never? Because in that case it probably should be *ptr=alloc(sizeof(**ptr)), unless you are doing something horrible ;-)

Alexander

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ