int param_status = false;
int numberedParam = 0;
int enc = 0;
- int start_status = 0;
char* temp = NULL;
char* pVTree = NULL;
bool vmsg_ended = false;
if (!strncmp(szMsgBegin, "VCARD", strlen("VCARD"))) {
VDATA_TRACE("pVTree: %s", pVTree);
pVCard = vcard_decode(pVTree);
- pCurrent->pNext = pVCard;
+ if (pCurrent) {
+ pCurrent->pNext = pVCard;
+ }
pCurrent = pVCard;
dLen = ((strstr(pMsgRaw, "END:VCARD") + 9) - pMsgRaw);
pMsgRaw += dLen;
} else {
-
- if (start_status == 1)
- goto CATCH;
-
if (!strncmp(szMsgBegin, "VMSG", strlen("VMSG"))) {
if ((pVMsg = (VTree*)calloc(1, sizeof(VTree))) == NULL) {
- start_status = 1;
goto CATCH;
}
memset(pVMsg, 0x00, sizeof(VTree));
pCurrent = pVMsg;
} else if (!strncmp(szMsgBegin, "VBODY", strlen("VBODY"))) {
if ((pVBody = (VTree*)calloc(1, sizeof(VTree))) == NULL) {
- start_status = 1;
goto CATCH;
}
VDATA_TRACE("pMsgRawTmp: %s", pMsgRawTmp);
/* VFREE(pMsgRawTmp); */
- if (pVMsg->pTop == NULL) {
+ if (pVMsg && pVMsg->pTop == NULL) {
VDATA_TRACE("pVMsg->Top: NULL");
goto CATCH;
}
int total = 0;
int cnt = 0;
+ if (!pVMsgRaw || !pVMsgRaw->pTop) {
+ return NULL;
+ }
+
for (; cnt < pVMsgRaw->pTop->valueCount; cnt++) {
if (pVMsgRaw->pTop->pszValue[cnt] == NULL) {
break;
}
}
-
-
}
switch (pTmpTree->treeType) {