Index: ossp-pkg/rc/rc_anal.c RCS File: /v/ossp/cvs/ossp-pkg/rc/Attic/rc_anal.c,v rcsdiff -q -kk '-r1.15' '-r1.16' -u '/v/ossp/cvs/ossp-pkg/rc/Attic/rc_anal.c,v' 2>/dev/null --- rc_anal.c 2003/05/26 16:03:56 1.15 +++ rc_anal.c 2003/05/27 14:51:38 1.16 @@ -247,8 +247,11 @@ /* just copies of the stack parameters passed in. */ int nIter = 0; - while (pInst->m_szRcs[nIter]) /* Rc file names */ - free(pInst->m_szRcs[nIter++]); + assert(pInst); /* Verify sanity */ + + if (pInst->m_szRcs && pInst->m_szRcs[nIter]) + while (pInst->m_szRcs[nIter]) /* Rc file names */ + free(pInst->m_szRcs[nIter++]); if (pInst->m_szRcs) /* Rc file name index */ free(pInst->m_szRcs); if (pInst->m_szTmp) /* Temp file name */ Index: ossp-pkg/rc/rc_util.c RCS File: /v/ossp/cvs/ossp-pkg/rc/rc_util.c,v rcsdiff -q -kk '-r1.8' '-r1.9' -u '/v/ossp/cvs/ossp-pkg/rc/rc_util.c,v' 2>/dev/null --- rc_util.c 2003/05/20 17:14:17 1.8 +++ rc_util.c 2003/05/27 14:51:38 1.9 @@ -57,6 +57,7 @@ { int nSecs = 0; int nIndex = 0; + size_t nBytes = 0; char **pszTemp = NULL; if (kpszVec) { @@ -64,9 +65,9 @@ pszTemp = malloc(sizeof (char **) * nSecs + 1); for (nIndex = 0; kpszVec[nIndex]; nIndex++) { /* Copy loop */ - pszTemp[nIndex] = malloc(strlen(kpszVec[nIndex])); /* for each */ - memcpy(pszTemp[nIndex], kpszVec[nIndex], /* element */ - strlen(kpszVec[nIndex])); /* in vector */ + nBytes = (strlen(kpszVec[nIndex]) + 1) * sizeof(char); /* for each */ + pszTemp[nIndex] = malloc(nBytes); /* element */ + memcpy(pszTemp[nIndex], kpszVec[nIndex], nBytes); /* in vector */ } pszTemp[nIndex] = NULL; /* Used later to find the end of the array */ return(pszTemp); /* Success */