int retry = 0;
const int retry_max = 20;
- sprintf(*tmp_path, "%s.tmp", path);
+ snprintf(*tmp_path, tmp_path_len + 10, "%s.tmp", path);
while(access(*tmp_path, F_OK) != -1 && ++retry < retry_max) {
- sprintf(*tmp_path, "%s.tmp%d", path, retry);
+ snprintf(*tmp_path, tmp_path_len + 10, "%s.tmp%d", path, retry);
}
if (retry >= retry_max) {
MAPS_LOGD("There are already too many temporary files.");
}
gmod->path = g_strnfill(100, 0);
- g_sprintf(gmod->path, "%s/%s", MAPS_PLUGINS_PATH_PREFIX, gmod->name);
if (!gmod->path) {
//LCOV_EXCL_START
g_free(gmod->name);
return NULL;
//LCOV_EXCL_STOP
}
+ g_snprintf(gmod->path, 100, "%s/%s", MAPS_PLUGINS_PATH_PREFIX, gmod->name);
gmod->module = g_module_open(gmod->path, G_MODULE_BIND_LAZY);
if (!gmod->module) {