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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 14 Aug 2016 13:12:33 -0700
From:	Mark D Rustad <mrustad@...il.com>
To:	Jonathan Corbet <corbet@....net>
Cc:	Jean Delvare <jdelvare@...e.de>, linux-doc@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Markus Elfring <elfring@...rs.sourceforge.net>
Subject: Re: [PATCH] CodingStyle: Clarify and complete chapter 7

Jonathan Corbet <corbet@....net> wrote:

> On Mon, 25 Jul 2016 14:29:06 +0200
> Jean Delvare <jdelvare@...e.de> wrote:
>
>> Chapter 7 (Centralized exiting of functions) of the coding style
>> documentation is unclear at times, and lacks some information (such
>> as the possibility to indent labels with a single space.) Clarify and
>> complete it.
>
> OK, I've applied this (finally) to the docs tree, sorry for sitting on it
> for so long.  One question, though...
>
>> A common type of bug to be aware of is "one err bugs" which look like  
>> this:
>>
>> -	err:
>> +	 err:
>>  		kfree(foo->bar);
>>  		kfree(foo);
>>  		return ret;
>>
>>  The bug in this code is that on some exit paths "foo" is NULL.  Normally the
>
> ...except that kfree() can handle null pointers just fine, so this isn't
> actually a bug, right?  Someday when somebody has time it would be good to
> come up with a better example.

But if foo is NULL, foo->bar is not NULL and so kfree will have a problem  
with it. So this is a bug.

--
Mark Rustad, MRustad@...il.com

Download attachment "signature.asc" of type "application/pgp-signature" (842 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ