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

Seth Arnold seth.arnold at canonical.com
Sat Jan 16 03:10:43 UTC 2016


Coverity issue "56025 Uninitialized scalar field" reports the 'label' member
of class Node may be used uninitialized. While this is a debugging-only
integer and may be a false positive in actual use, the fix should be easy
and remove an issue from our dashboard:

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 02:30:29 +0000
@@ -96,13 +96,13 @@
 /* An abstract node in the syntax tree. */
 class Node {
 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;
 	}
-	Node(Node *left, Node *right): nullable(false)
+	Node(Node *left, Node *right): nullable(false), label(0)
 	{
 		child[0] = left;
 		child[1] = right;

Compiled, passed the tests with the exception of bug 1534869, but that
also shows in 14.04 LTS packaging.

I checked that:
../apparmor_parser -Q -D dfa-states ./simple_tests/file/
gave output that looked about right.

Thanks
-------------- 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/33149c24/attachment.pgp>


More information about the AppArmor mailing list