OSSP CVS Repository

ossp - Difference in ossp-pkg/rc/rc_sect.c versions 1.6 and 1.7
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/rc/rc_sect.c 1.6 -> 1.7

--- rc_sect.c    2003/05/16 18:43:31     1.6
+++ rc_sect.c    2003/05/19 19:03:06     1.7
@@ -66,14 +66,18 @@
     pSec->m_Bytes   = pOrigsec->m_Bytes;
 
     /* Deep copy of user name */
-    pSec->m_szLogin = malloc((strlen(pOrigsec->m_szLogin) + sizeof(char))\
-        * sizeof(char));
-    strcpy(pSec->m_szLogin, pOrigsec->m_szLogin);
+    if (pOrigsec->m_szLogin) {
+        pSec->m_szLogin = malloc((strlen(pOrigsec->m_szLogin) + sizeof(char))\
+            * sizeof(char));
+        strcpy(pSec->m_szLogin, pOrigsec->m_szLogin);
+    }
 
     /* Deep copy of section text */
-    pSec->m_szData  = malloc((strlen(pOrigsec->m_szData) + sizeof(char))\
-        * sizeof(char));
-    strcpy(pSec->m_szData, pOrigsec->m_szData);
+    if (pOrigsec->m_szData) {
+        pSec->m_szData  = malloc((strlen(pOrigsec->m_szData) + sizeof(char))\
+            * sizeof(char));
+        strcpy(pSec->m_szData, pOrigsec->m_szData);
+    }
 
     if (!pSec)
         RC_THROW(RC_ERR_MEM);

CVSTrac 2.0.1