# HG changeset patch
# User Jim Fehlig <jfehlig(a)novell.com>
# Date 1236099840 25200
# Node ID e3dd4cec1b61373e738fe3ba58557ae543b41789
# Parent 8e4577bb3b3a6e1af8dbcf1887641571b0cfdedb
Do not pass NULL to strchr()
get_typed_class() in libxkutil can segfault a provider if refcn
parameter is NULL. Ensure refcn is non-NULL before subsequent use.
Signed-off-by: Jim Fehlig <jfehlig(a)novell.com>
diff -r 8e4577bb3b3a -r e3dd4cec1b61 libxkutil/misc_util.c
--- a/libxkutil/misc_util.c Fri Feb 27 18:08:06 2009 -0300
+++ b/libxkutil/misc_util.c Tue Mar 03 10:04:00 2009 -0700
@@ -218,6 +218,9 @@ char *get_typed_class(const char *refcn,
char *class = NULL;
char *pfx;
+ if (refcn == NULL)
+ return NULL;
+
if (strchr(refcn, '_'))
pfx = class_prefix_name(refcn);
else
_______________________________________________
Libvirt-cim mailing list
Libvirt-cim(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim
--
Richard Maciel, MSc
IBM Linux Technology Center
rmaciel(a)linux.vnet.ibm.com