[cmake-commits] hoffman committed cmCPackTarCompressGenerator.cxx 1.7 1.8

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Mar 20 11:44:39 EST 2007


Update of /cvsroot/CMake/CMake/Source/CPack
In directory public:/mounts/ram/cvs-serv20134

Modified Files:
	cmCPackTarCompressGenerator.cxx 
Log Message:
BUG: fix coverity error, null check after usage fix


Index: cmCPackTarCompressGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackTarCompressGenerator.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- cmCPackTarCompressGenerator.cxx	30 Oct 2006 16:22:48 -0000	1.7
+++ cmCPackTarCompressGenerator.cxx	20 Mar 2007 16:44:36 -0000	1.8
@@ -225,15 +225,18 @@
 int cmCPackTarCompress_Compress_Output(void* client_data,
   const char* data, int data_length)
 {
+  if(!client_data)
+    {
+    return 0;
+    }
   cmcompress_stream *cstream = static_cast<cmcompress_stream*>(client_data);
   cmCPackTarCompress_Data *mydata
     = static_cast<cmCPackTarCompress_Data*>(cstream->client_data);
-  mydata->OutputStream->write(data, data_length);
-
   if ( !mydata->OutputStream )
     {
     return 0;
     }
+  mydata->OutputStream->write(data, data_length);
   return data_length;
 }
 



More information about the Cmake-commits mailing list