projects
/
platform
/
core
/
messaging
/
msg-service.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix svace issues
[platform/core/messaging/msg-service.git]
/
vobject-engine
/
VMessage.c
diff --git
a/vobject-engine/VMessage.c
b/vobject-engine/VMessage.c
index
782733d
..
50da899
100755
(executable)
--- a/
vobject-engine/VMessage.c
+++ b/
vobject-engine/VMessage.c
@@
-788,7
+788,6
@@
VTree* vmsg_decode(char *pMsgRaw)
int param_status = false;
int numberedParam = 0;
int enc = 0;
int param_status = false;
int numberedParam = 0;
int enc = 0;
- int start_status = 0;
char* temp = NULL;
char* pVTree = NULL;
bool vmsg_ended = false;
char* temp = NULL;
char* pVTree = NULL;
bool vmsg_ended = false;
@@
-841,19
+840,16
@@
VTree* vmsg_decode(char *pMsgRaw)
if (!strncmp(szMsgBegin, "VCARD", strlen("VCARD"))) {
VDATA_TRACE("pVTree: %s", pVTree);
pVCard = vcard_decode(pVTree);
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 {
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) {
if (!strncmp(szMsgBegin, "VMSG", strlen("VMSG"))) {
if ((pVMsg = (VTree*)calloc(1, sizeof(VTree))) == NULL) {
- start_status = 1;
goto CATCH;
}
memset(pVMsg, 0x00, sizeof(VTree));
goto CATCH;
}
memset(pVMsg, 0x00, sizeof(VTree));
@@
-865,7
+861,6
@@
VTree* vmsg_decode(char *pMsgRaw)
pCurrent = pVMsg;
} else if (!strncmp(szMsgBegin, "VBODY", strlen("VBODY"))) {
if ((pVBody = (VTree*)calloc(1, sizeof(VTree))) == NULL) {
pCurrent = pVMsg;
} else if (!strncmp(szMsgBegin, "VBODY", strlen("VBODY"))) {
if ((pVBody = (VTree*)calloc(1, sizeof(VTree))) == NULL) {
- start_status = 1;
goto CATCH;
}
goto CATCH;
}
@@
-1023,7
+1018,7
@@
VTree* vmsg_decode(char *pMsgRaw)
VDATA_TRACE("pMsgRawTmp: %s", pMsgRawTmp);
/* VFREE(pMsgRawTmp); */
VDATA_TRACE("pMsgRawTmp: %s", pMsgRawTmp);
/* VFREE(pMsgRawTmp); */
- if (pVMsg->pTop == NULL) {
+ if (pVMsg
&& pVMsg
->pTop == NULL) {
VDATA_TRACE("pVMsg->Top: NULL");
goto CATCH;
}
VDATA_TRACE("pVMsg->Top: NULL");
goto CATCH;
}
@@
-1063,6
+1058,10
@@
char* vmsg_encode(VTree *pVMsgRaw)
int total = 0;
int cnt = 0;
int total = 0;
int cnt = 0;
+ if (!pVMsgRaw || !pVMsgRaw->pTop) {
+ return NULL;
+ }
+
for (; cnt < pVMsgRaw->pTop->valueCount; cnt++) {
if (pVMsgRaw->pTop->pszValue[cnt] == NULL) {
for (; cnt < pVMsgRaw->pTop->valueCount; cnt++) {
if (pVMsgRaw->pTop->pszValue[cnt] == NULL) {
@@
-1163,8
+1162,6
@@
char* vmsg_encode(VTree *pVMsgRaw)
break;
}
}
break;
}
}
-
-
}
switch (pTmpTree->treeType) {
}
switch (pTmpTree->treeType) {