[apparmor] [patch] Fix Coverity issue 56025 -- Uninitialized scalar field
Seth Arnold
seth.arnold at canonical.com
Sat Jan 16 03:24:09 UTC 2016
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>
=== 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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20160115/263799c0/attachment.pgp>
More information about the AppArmor
mailing list