[Libvirt-cim] [PATCH] libcmpiutil, fix potential debug print crash

xiaxia347work xiaxia347work at 163.com
Fri Oct 26 12:30:22 UTC 2012


  It seems libcmpiutil still uses HG, sorry I forgot how to send patch with HG, so
paste the patch directly here and attach the patch generated from "hg export"
as attachement.

exporting patch:
# HG changeset patch
# User Wenchao Xia <xiawenc at linux.vnet.ibm.com>
# Date 1351243349 -28800
# Node ID 67a7b959ed47188efb8eb2f462bc7fc9ee145041
# Parent  2984ede9c082bab48b3494ef4b9f5561fadef2ad
fix potential crash bug

diff -r 2984ede9c082 -r 67a7b959ed47 std_indication.c
--- a/std_indication.c	Tue May 24 10:45:46 2011 -0400
+++ b/std_indication.c	Fri Oct 26 17:22:29 2012 +0800
@@ -141,7 +141,12 @@
 
         enabled = is_ind_enabled(ctx, ind_name, &s);
         if (s.rc != CMPI_RC_OK) {
-                CU_DEBUG("Problem checking enabled: '%s'", CMGetCharPtr(s.msg));
+                if (s.msg != NULL) {
+                        CU_DEBUG("Problem checking enabled: '%s'",
+                                                   CMGetCharPtr(s.msg));
+                } else {
+                        CU_DEBUG("Problem checking enabled, msg is NULL");
+                }
                 goto out;
         }
 
@@ -176,7 +181,12 @@
 
         enabled = is_ind_enabled(args->_ctx, ind_name, &s);
         if (s.rc != CMPI_RC_OK) {
-                CU_DEBUG("Problem checking enabled: '%s'", CMGetCharPtr(s.msg));
+                if (s.msg != NULL) {
+                        CU_DEBUG("Problem checking enabled: '%s'",
+                                                  CMGetCharPtr(s.msg));
+                } else {
+                        CU_DEBUG("Problem checking enabled, msg is NULL");
+                }
                 goto out;
         }
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libcmpiutil_fix_crash.patch
Type: application/octet-stream
Size: 1476 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20121026/63e192c0/attachment.obj>


More information about the Libvirt-cim mailing list