diff options
author | Ashish Dhiman <dhiman@codeaurora.org> | 2015-02-09 12:49:29 +0530 |
---|---|---|
committer | Ashish Dhiman <dhiman@codeaurora.org> | 2015-02-10 13:47:14 +0530 |
commit | b45b1606db28e031b1fd5a5bea0f32a63a0754dc (patch) | |
tree | 4d8bf7474f9dabc239a97552d1fb9f002ba613b4 /utils/loc_cfg.cpp | |
parent | 119c7a6410af606b16a41a1a17617344c54282b3 (diff) | |
download | gps-b45b1606db28e031b1fd5a5bea0f32a63a0754dc.tar.gz |
Klockwork P1 issues.
fixing Klockwork P1 issues.
CRs-Fixed: 793601
Change-Id: I037c17c342f473d6d21a234ec1e980ba55b98cbe
Diffstat (limited to 'utils/loc_cfg.cpp')
-rw-r--r-- | utils/loc_cfg.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 404f3ed..7ffe6a4 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -329,9 +329,14 @@ int loc_update_conf(const char* conf_data, int32_t length, if (conf_data && length && config_table && table_length) { // make a copy, so we do not tokenize the original data char* conf_copy = (char*)malloc(length+1); - memcpy(conf_copy, conf_data, length); - // we hard NULL the end of string to be safe - conf_copy[length] = 0; + + if(conf_copy !=NULL) + { + 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 uint32_t num_params = table_length - 1; char* saveptr = NULL; |