[apparmor] [patch] Fix Coverity issue 56025 -- Uninitialized scalar field

John Johansen john.johansen at canonical.com
Sat Jan 16 06:58:28 UTC 2016


On 01/15/2016 07:24 PM, Seth Arnold wrote:
> On Fri, Jan 15, 2016 at 07:10:43PM -0800, Seth Arnold wrote:
>>  public:
>> -	Node(): nullable(false) { child[0] = child[1] = 0; }
>> +	Node(): nullable(false), label(0) { child[0] = child[1] = 0; }
>>  	Node(Node *left): nullable(false)
>>  	{
>>  		child[0] = left;
>>  		child[1] = 0;
>>  	}
> 
> Sigh, I overlooked this case. Revised patch attached.
> 
>> -	Node(Node *left, Node *right): nullable(false)
>> +	Node(Node *left, Node *right): nullable(false), label(0)
>>  	{
>>  		child[0] = left;
>>  		child[1] = right;
>>
> 
> Signed-off-by: Seth Arnold <seth.arnold at canonical.com>
> 
Acked-by: John Johansen <john.johansen at canonical.com>

> === modified file 'parser/libapparmor_re/expr-tree.h'
> --- parser/libapparmor_re/expr-tree.h	2015-10-14 20:49:26 +0000
> +++ parser/libapparmor_re/expr-tree.h	2016-01-16 03:15:33 +0000
> @@ -96,13 +96,13 @@
>  /* An abstract node in the syntax tree. */
>  class Node {
>  public:
> -	Node(): nullable(false) { child[0] = child[1] = 0; }
> -	Node(Node *left): nullable(false)
> +	Node(): nullable(false), label(0) { child[0] = child[1] = 0; }
> +	Node(Node *left): nullable(false), label(0)
>  	{
>  		child[0] = left;
>  		child[1] = 0;
>  	}
> -	Node(Node *left, Node *right): nullable(false)
> +	Node(Node *left, Node *right): nullable(false), label(0)
>  	{
>  		child[0] = left;
>  		child[1] = right;
> 
> 
> 




More information about the AppArmor mailing list