+1
Sharad Mishra
Open Virtualization
Linux Technology Center
IBM
libvirt-cim-bounces(a)redhat.com wrote on 11/03/2011 10:48:29 AM:
"Eduardo Lima (Etrunko)" <eblima(a)linux.vnet.ibm.com>
Sent by: libvirt-cim-bounces(a)redhat.com
11/03/2011 10:48 AM
Please respond to
List for discussion and development of libvirt CIM
<libvirt-cim(a)redhat.com>
To
libvirt-cim(a)redhat.com
cc
"Eduardo Lima \(Etrunko\)" <eblima(a)br.ibm.com>
Subject
[Libvirt-cim] [PATCH 1/8] acl_parsing: Avoid NULL dereference
From: Eduardo Lima (Etrunko) <eblima(a)br.ibm.com>
As revealed by Coverity scan report:
https://bugzilla.redhat.com/show_bug.cgi?id=728245#c8
https://bugzilla.redhat.com/attachment.cgi?id=530435
Error: REVERSE_INULL:
acl_parsing.c:172: deref_ptr: Directly dereferencing pointer "filters".
acl_parsing.c:174: check_after_deref: Dereferencing "filters" before a
null
check.
Signed-off-by: Eduardo Lima (Etrunko) <eblima(a)br.ibm.com>
---
libxkutil/acl_parsing.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/libxkutil/acl_parsing.c b/libxkutil/acl_parsing.c
index 935e642..7cde1f0 100644
--- a/libxkutil/acl_parsing.c
+++ b/libxkutil/acl_parsing.c
@@ -151,11 +151,13 @@ void cleanup_filter(struct acl_filter *filter)
void cleanup_filters(struct acl_filter **filters, int count)
{
int i;
- struct acl_filter *_filters = *filters;
+ struct acl_filter *_filters;
if((filters == NULL) || (*filters == NULL) || (count == 0))
return;
+ _filters = *filters;
+
for (i = 0; i < count; i++)
cleanup_filter(&_filters[i]);
--
1.7.4.4
_______________________________________________
Libvirt-cim mailing list
Libvirt-cim(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim