Klockwork P1 issues.

fixing Klockwork P1 issues.

CRs-Fixed: 793601
Change-Id: I037c17c342f473d6d21a234ec1e980ba55b98cbe
This commit is contained in:
Ashish Dhiman 2015-02-09 12:49:29 +05:30
parent 119c7a6410
commit b45b1606db

View file

@ -329,9 +329,14 @@ int loc_update_conf(const char* conf_data, int32_t length,
if (conf_data && length && config_table && table_length) { if (conf_data && length && config_table && table_length) {
// make a copy, so we do not tokenize the original data // make a copy, so we do not tokenize the original data
char* conf_copy = (char*)malloc(length+1); char* conf_copy = (char*)malloc(length+1);
memcpy(conf_copy, conf_data, length);
// we hard NULL the end of string to be safe if(conf_copy !=NULL)
conf_copy[length] = 0; {
memcpy(conf_copy, conf_data, length);
// we hard NULL the end of string to be safe
conf_copy[length] = 0;
}
// start with one record off // start with one record off
uint32_t num_params = table_length - 1; uint32_t num_params = table_length - 1;
char* saveptr = NULL; char* saveptr = NULL;