int hexaStringSize = (len * 2) + 1;
char* hexaStringP = malloc(hexaStringSize);
+ if(!hexaStringP)
+ return -1;
TRACE(MSGL_VGSM_INFO, "hexaStringSize:%d\n", hexaStringSize);
if (datasize <= MAX_HDLC_FRAME_SIZE) {
// allocate memory
rawdata = malloc(datasize + 1);
+ if(!rawdata)
+ return -1;
// make at rawdata
rc = make_single_at(data, datasize, rawdata);
TRACE(MSGL_VGSM_INFO, "\n");
- assert(!(pProactiveCmd->length&0xff00));
+ // this is always passed because (pProactiveCmd->length&0xff00) is always 0, so comment out
+ //assert(!(pProactiveCmd->length&0xff00));
data[n++] = (pProactiveCmd->length)&0xff;
- data[n++] = (pProactiveCmd->length >> 8)&0xff;
+ // this is always 0 because (pProactiveCmd->length >> 8) is 0, so fix like below
+ //data[n++] = (pProactiveCmd->length >> 8)&0xff;
+ data[n++] = 0;
+
memcpy(&data[n], pProactiveCmd->cmd, pProactiveCmd->length);
n += pProactiveCmd->length;