Unverified Commit 04f71bd5 authored by Vitalii Koshura's avatar Vitalii Koshura

Merge branch 'dpa_memset' into upstream_master

Signed-off-by: default avatarVitalii Koshura <lestat.de.lionkur@gmail.com>
parents 504a2bb4 35749539
...@@ -1082,7 +1082,7 @@ int ACTIVE_TASK::handle_upload_files() { ...@@ -1082,7 +1082,7 @@ int ACTIVE_TASK::handle_upload_files() {
"Can't find uploadable file %s", p "Can't find uploadable file %s", p
); );
} }
snprintf(path, sizeof(path), "%s/%s", slot_dir, buf); snprintf(path, sizeof(path), "%.*s/%.*s", DIR_LEN, slot_dir, FILE_LEN, buf);
delete_project_owned_file(path, true); // delete the link file delete_project_owned_file(path, true); // delete the link file
} }
} }
......
...@@ -542,7 +542,7 @@ void ACTIVE_TASK::handle_exited_app(int stat) { ...@@ -542,7 +542,7 @@ void ACTIVE_TASK::handle_exited_app(int stat) {
snprintf(err_msg, sizeof(err_msg), snprintf(err_msg, sizeof(err_msg),
"process exited with code %d (0x%x, %d)", "process exited with code %d (0x%x, %d)",
result->exit_status, result->exit_status, result->exit_status, result->exit_status,
(-1<<8)|result->exit_status (~0xff)|result->exit_status
); );
gstate.report_result_error(*result, err_msg); gstate.report_result_error(*result, err_msg);
} else { } else {
...@@ -1554,7 +1554,7 @@ void ACTIVE_TASK_SET::get_msgs() { ...@@ -1554,7 +1554,7 @@ void ACTIVE_TASK_SET::get_msgs() {
} }
if (atp->get_app_status_msg()) { if (atp->get_app_status_msg()) {
if (old_time != atp->checkpoint_cpu_time) { if (old_time != atp->checkpoint_cpu_time) {
char buf[256]; char buf[512];
sprintf(buf, "%s checkpointed", atp->result->name); sprintf(buf, "%s checkpointed", atp->result->name);
if (atp->overdue_checkpoint) { if (atp->overdue_checkpoint) {
gstate.request_schedule_cpus(buf); gstate.request_schedule_cpus(buf);
......
...@@ -351,7 +351,7 @@ static int create_dirs_for_logical_name( ...@@ -351,7 +351,7 @@ static int create_dirs_for_logical_name(
static void prepend_prefix(APP_VERSION* avp, char* in, char* out, int len) { static void prepend_prefix(APP_VERSION* avp, char* in, char* out, int len) {
if (strlen(avp->file_prefix)) { if (strlen(avp->file_prefix)) {
snprintf(out, len, "%s/%s", avp->file_prefix, in); snprintf(out, len, "%.16s/%.200s", avp->file_prefix, in);
} else { } else {
strlcpy(out, in, len); strlcpy(out, in, len);
} }
...@@ -467,7 +467,7 @@ int ACTIVE_TASK::link_user_files() { ...@@ -467,7 +467,7 @@ int ACTIVE_TASK::link_user_files() {
} }
int ACTIVE_TASK::copy_output_files() { int ACTIVE_TASK::copy_output_files() {
char slotfile[256], projfile[256], open_name[256]; char slotfile[MAXPATHLEN], projfile[256], open_name[256];
unsigned int i; unsigned int i;
for (i=0; i<result->output_files.size(); i++) { for (i=0; i<result->output_files.size(); i++) {
FILE_REF& fref = result->output_files[i]; FILE_REF& fref = result->output_files[i];
...@@ -476,7 +476,7 @@ int ACTIVE_TASK::copy_output_files() { ...@@ -476,7 +476,7 @@ int ACTIVE_TASK::copy_output_files() {
prepend_prefix( prepend_prefix(
app_version, fref.open_name, open_name, sizeof(open_name) app_version, fref.open_name, open_name, sizeof(open_name)
); );
snprintf(slotfile, sizeof(slotfile), "%s/%s", slot_dir, open_name); snprintf(slotfile, sizeof(slotfile), "%.*s/%.*s", DIR_LEN, slot_dir, FILE_LEN, open_name);
get_pathname(fip, projfile, sizeof(projfile)); get_pathname(fip, projfile, sizeof(projfile));
int retval = boinc_rename(slotfile, projfile); int retval = boinc_rename(slotfile, projfile);
// the rename fails if the output file isn't there. // the rename fails if the output file isn't there.
...@@ -1108,7 +1108,7 @@ int ACTIVE_TASK::start(bool test) { ...@@ -1108,7 +1108,7 @@ int ACTIVE_TASK::start(bool test) {
if (test) { if (test) {
strcpy(buf, exec_path); strcpy(buf, exec_path);
} else { } else {
snprintf(buf, sizeof(buf), "../../%s", exec_path); snprintf(buf, sizeof(buf), "../../%.1024s", exec_path);
} }
if (g_use_sandbox) { if (g_use_sandbox) {
char switcher_path[MAXPATHLEN]; char switcher_path[MAXPATHLEN];
...@@ -1167,7 +1167,7 @@ error: ...@@ -1167,7 +1167,7 @@ error:
// //
gstate.input_files_available(result, true); gstate.input_files_available(result, true);
char err_msg[4096]; char err_msg[4096];
snprintf(err_msg, sizeof(err_msg), "couldn't start app: %s", buf); snprintf(err_msg, sizeof(err_msg), "couldn't start app: %.256s", buf);
gstate.report_result_error(*result, err_msg); gstate.report_result_error(*result, err_msg);
if (log_flags.task_debug) { if (log_flags.task_debug) {
msg_printf(wup->project, MSG_INFO, msg_printf(wup->project, MSG_INFO,
......
...@@ -426,7 +426,7 @@ int main(int argc, char** argv) { ...@@ -426,7 +426,7 @@ int main(int argc, char** argv) {
} }
} else if (!strcmp(cmd, "--set_host_info")) { } else if (!strcmp(cmd, "--set_host_info")) {
HOST_INFO h; HOST_INFO h;
memset(&h, 0, sizeof(h)); h.clear();
char* pn = next_arg(argc, argv, i); char* pn = next_arg(argc, argv, i);
safe_strcpy(h.product_name, pn); safe_strcpy(h.product_name, pn);
retval = rpc.set_host_info(h); retval = rpc.set_host_info(h);
......
...@@ -55,7 +55,7 @@ void show_message( ...@@ -55,7 +55,7 @@ void show_message(
PROJ_AM *p, char* msg, int priority, bool is_html, const char* link PROJ_AM *p, char* msg, int priority, bool is_html, const char* link
) { ) {
const char* x; const char* x;
char message[1024], event_msg[1024], evt_message[2048]; char message[1024], event_msg[2048], evt_message[2048];
double t = dtime(); double t = dtime();
char* time_string = time_to_string(t); char* time_string = time_to_string(t);
...@@ -78,7 +78,7 @@ void show_message( ...@@ -78,7 +78,7 @@ void show_message(
snprintf(event_msg, sizeof(event_msg), "[error] %s", message); snprintf(event_msg, sizeof(event_msg), "[error] %s", message);
break; break;
case MSG_SCHEDULER_ALERT: case MSG_SCHEDULER_ALERT:
snprintf(event_msg, sizeof(event_msg), "%s: %s", snprintf(event_msg, sizeof(event_msg), "%.64s: %s",
_("Message from server"), message _("Message from server"), message
); );
break; break;
......
...@@ -226,8 +226,14 @@ struct DAILY_STATS { ...@@ -226,8 +226,14 @@ struct DAILY_STATS {
double host_expavg_credit; double host_expavg_credit;
double day; double day;
void clear(); DAILY_STATS(int){}
DAILY_STATS() {clear();} void clear() {
static const DAILY_STATS x(0);
*this = x;
}
DAILY_STATS() {
clear();
}
int parse(FILE*); int parse(FILE*);
}; };
bool operator < (const DAILY_STATS&, const DAILY_STATS&); bool operator < (const DAILY_STATS&, const DAILY_STATS&);
...@@ -273,7 +279,14 @@ struct APP { ...@@ -273,7 +279,14 @@ struct APP {
bool ignore; bool ignore;
#endif #endif
APP() {memset(this, 0, sizeof(APP));} APP(int){}
void clear() {
static const APP x(0);
*this = x;
}
APP(){
clear();
}
int parse(XML_PARSER&); int parse(XML_PARSER&);
int write(MIOFILE&); int write(MIOFILE&);
}; };
......
...@@ -1227,7 +1227,7 @@ bool CLIENT_STATE::enforce_run_list(vector<RESULT*>& run_list) { ...@@ -1227,7 +1227,7 @@ bool CLIENT_STATE::enforce_run_list(vector<RESULT*>& run_list) {
// and prune those that can't be assigned // and prune those that can't be assigned
// //
assign_coprocs(run_list); assign_coprocs(run_list);
bool scheduled_mt = false; //bool scheduled_mt = false;
// prune jobs that don't fit in RAM or that exceed CPU usage limits. // prune jobs that don't fit in RAM or that exceed CPU usage limits.
// Mark the rest as SCHEDULED // Mark the rest as SCHEDULED
...@@ -1337,9 +1337,11 @@ bool CLIENT_STATE::enforce_run_list(vector<RESULT*>& run_list) { ...@@ -1337,9 +1337,11 @@ bool CLIENT_STATE::enforce_run_list(vector<RESULT*>& run_list) {
continue; continue;
} }
#if 0
if (rp->avp->avg_ncpus > 1) { if (rp->avp->avg_ncpus > 1) {
scheduled_mt = true; scheduled_mt = true;
} }
#endif
ncpus_used += rp->avp->avg_ncpus; ncpus_used += rp->avp->avg_ncpus;
atp->next_scheduler_state = CPU_SCHED_SCHEDULED; atp->next_scheduler_state = CPU_SCHED_SCHEDULED;
ram_left -= wss; ram_left -= wss;
......
...@@ -358,10 +358,6 @@ int CLIENT_STATE::parse_account_files() { ...@@ -358,10 +358,6 @@ int CLIENT_STATE::parse_account_files() {
return 0; return 0;
} }
void DAILY_STATS::clear() {
memset(this, 0, sizeof(DAILY_STATS));
}
int DAILY_STATS::parse(FILE* in) { int DAILY_STATS::parse(FILE* in) {
MIOFILE mf; MIOFILE mf;
XML_PARSER xp(&mf); XML_PARSER xp(&mf);
......
...@@ -175,7 +175,6 @@ int cpu_benchmarks(BENCHMARK_DESC* bdp) { ...@@ -175,7 +175,6 @@ int cpu_benchmarks(BENCHMARK_DESC* bdp) {
double vax_mips, int_loops=0, int_time=0, fp_time; double vax_mips, int_loops=0, int_time=0, fp_time;
bdp->error_str[0] = '\0'; bdp->error_str[0] = '\0';
host_info.clear_host_info();
#if defined(ANDROID) && defined(__arm__) #if defined(ANDROID) && defined(__arm__)
// check for FP accelerator: VFP, Neon, or none; // check for FP accelerator: VFP, Neon, or none;
......
...@@ -192,7 +192,7 @@ int FILE_INFO::verify_file( ...@@ -192,7 +192,7 @@ int FILE_INFO::verify_file(
// see if we need to unzip it // see if we need to unzip it
// //
if (download_gzipped && !boinc_file_exists(pathname)) { if (download_gzipped && !boinc_file_exists(pathname)) {
char gzpath[MAXPATHLEN]; char gzpath[MAXPATHLEN+16];
snprintf(gzpath, sizeof(gzpath), "%s.gz", pathname); snprintf(gzpath, sizeof(gzpath), "%s.gz", pathname);
if (boinc_file_exists(gzpath) ) { if (boinc_file_exists(gzpath) ) {
if (allow_async && nbytes > ASYNC_FILE_THRESHOLD) { if (allow_async && nbytes > ASYNC_FILE_THRESHOLD) {
...@@ -417,7 +417,7 @@ bool CLIENT_STATE::create_and_delete_pers_file_xfers() { ...@@ -417,7 +417,7 @@ bool CLIENT_STATE::create_and_delete_pers_file_xfers() {
// If this was a compressed download, rename .gzt to .gz // If this was a compressed download, rename .gzt to .gz
// //
if (fip->download_gzipped) { if (fip->download_gzipped) {
char path[MAXPATHLEN], from_path[MAXPATHLEN], to_path[MAXPATHLEN]; char path[MAXPATHLEN], from_path[MAXPATHLEN+16], to_path[MAXPATHLEN+16];
get_pathname(fip, path, sizeof(path)); get_pathname(fip, path, sizeof(path));
snprintf(from_path, sizeof(from_path), "%s.gzt", path); snprintf(from_path, sizeof(from_path), "%s.gzt", path);
snprintf(to_path, sizeof(to_path), "%s.gz", path); snprintf(to_path, sizeof(to_path), "%s.gz", path);
......
...@@ -98,7 +98,7 @@ static void write_rss_feed_descs(MIOFILE& fout, vector<RSS_FEED>& feeds) { ...@@ -98,7 +98,7 @@ static void write_rss_feed_descs(MIOFILE& fout, vector<RSS_FEED>& feeds) {
} }
static void write_project_feed_list(PROJ_AM* p) { static void write_project_feed_list(PROJ_AM* p) {
char buf[256]; char buf[MAXPATHLEN];
project_feed_list_file_name(p, buf, sizeof(buf)); project_feed_list_file_name(p, buf, sizeof(buf));
FILE* f = fopen(buf, "w"); FILE* f = fopen(buf, "w");
if (!f) return; if (!f) return;
...@@ -619,7 +619,7 @@ void NOTICES::write(int seqno, GUI_RPC_CONN& grc, bool public_only) { ...@@ -619,7 +619,7 @@ void NOTICES::write(int seqno, GUI_RPC_CONN& grc, bool public_only) {
void RSS_FEED::feed_file_name(char* path, int len) { void RSS_FEED::feed_file_name(char* path, int len) {
char buf[256]; char buf[256];
escape_project_url(url_base, buf); escape_project_url(url_base, buf);
snprintf(path, len, NOTICES_DIR"/%s.xml", buf); snprintf(path, len, NOTICES_DIR"/%.128s.xml", buf);
} }
void RSS_FEED::archive_file_name(char* path, int len) { void RSS_FEED::archive_file_name(char* path, int len) {
......
...@@ -1187,7 +1187,7 @@ void CLIENT_STATE::check_project_timeout() { ...@@ -1187,7 +1187,7 @@ void CLIENT_STATE::check_project_timeout() {
PROJECT* p = projects[i]; PROJECT* p = projects[i];
if (p->possibly_backed_off && now > p->min_rpc_time) { if (p->possibly_backed_off && now > p->min_rpc_time) {
p->possibly_backed_off = false; p->possibly_backed_off = false;
char buf[256]; char buf[1024];
snprintf(buf, sizeof(buf), "Backoff ended for %s", p->get_project_name()); snprintf(buf, sizeof(buf), "Backoff ended for %s", p->get_project_name());
request_work_fetch(buf); request_work_fetch(buf);
} }
......
...@@ -243,7 +243,7 @@ void delete_old_slot_dirs() { ...@@ -243,7 +243,7 @@ void delete_old_slot_dirs() {
// Clean these up here. (We must do this before deleting the // Clean these up here. (We must do this before deleting the
// INIT_DATA_FILE, if any, from each slot directory.) // INIT_DATA_FILE, if any, from each slot directory.)
// //
snprintf(init_data_path, sizeof(init_data_path), "%s/%s", path, INIT_DATA_FILE); snprintf(init_data_path, sizeof(init_data_path), "%.*s/%.*s", DIR_LEN, path, FILE_LEN, INIT_DATA_FILE);
shmem_seg_name = ftok(init_data_path, 1); shmem_seg_name = ftok(init_data_path, 1);
if (shmem_seg_name != -1) { if (shmem_seg_name != -1) {
destroy_shmem(shmem_seg_name); destroy_shmem(shmem_seg_name);
......
...@@ -34,7 +34,7 @@ class FILE_XFER : public HTTP_OP { ...@@ -34,7 +34,7 @@ class FILE_XFER : public HTTP_OP {
public: public:
FILE_INFO* fip; FILE_INFO* fip;
char pathname[256]; char pathname[256];
char header[4096]; char header[8192];
bool file_size_query; bool file_size_query;
bool is_upload; bool is_upload;
double starting_size; double starting_size;
......
...@@ -201,7 +201,7 @@ void COPROCS::correlate_gpus( ...@@ -201,7 +201,7 @@ void COPROCS::correlate_gpus(
IGNORE_GPU_INSTANCE &ignore_gpu_instance IGNORE_GPU_INSTANCE &ignore_gpu_instance
) { ) {
unsigned int i; unsigned int i;
char buf[256], buf2[256]; char buf[256], buf2[1024];
nvidia.correlate(use_all, ignore_gpu_instance[PROC_TYPE_NVIDIA_GPU]); nvidia.correlate(use_all, ignore_gpu_instance[PROC_TYPE_NVIDIA_GPU]);
ati.correlate(use_all, ignore_gpu_instance[PROC_TYPE_AMD_GPU]); ati.correlate(use_all, ignore_gpu_instance[PROC_TYPE_AMD_GPU]);
...@@ -502,7 +502,7 @@ int COPROCS::read_coproc_info_file(vector<string> &warnings) { ...@@ -502,7 +502,7 @@ int COPROCS::read_coproc_info_file(vector<string> &warnings) {
} else { } else {
my_nvidia_gpu.device_num = (int)nvidia_gpus.size(); my_nvidia_gpu.device_num = (int)nvidia_gpus.size();
my_nvidia_gpu.pci_info = my_nvidia_gpu.pci_infos[0]; my_nvidia_gpu.pci_info = my_nvidia_gpu.pci_infos[0];
memset(&my_nvidia_gpu.pci_infos[0], 0, sizeof(struct PCI_INFO)); my_nvidia_gpu.pci_infos[0].clear();
nvidia_gpus.push_back(my_nvidia_gpu); nvidia_gpus.push_back(my_nvidia_gpu);
} }
continue; continue;
...@@ -519,10 +519,10 @@ int COPROCS::read_coproc_info_file(vector<string> &warnings) { ...@@ -519,10 +519,10 @@ int COPROCS::read_coproc_info_file(vector<string> &warnings) {
} }
if (xp.match_tag("ati_opencl")) { if (xp.match_tag("ati_opencl")) {
memset(&ati_opencl, 0, sizeof(ati_opencl)); ati_opencl.clear();
retval = ati_opencl.parse(xp, "/ati_opencl"); retval = ati_opencl.parse(xp, "/ati_opencl");
if (retval) { if (retval) {
memset(&ati_opencl, 0, sizeof(ati_opencl)); ati_opencl.clear();
} else { } else {
ati_opencl.is_used = COPROC_IGNORED; ati_opencl.is_used = COPROC_IGNORED;
ati_opencls.push_back(ati_opencl); ati_opencls.push_back(ati_opencl);
...@@ -531,10 +531,10 @@ int COPROCS::read_coproc_info_file(vector<string> &warnings) { ...@@ -531,10 +531,10 @@ int COPROCS::read_coproc_info_file(vector<string> &warnings) {
} }
if (xp.match_tag("nvidia_opencl")) { if (xp.match_tag("nvidia_opencl")) {
memset(&nvidia_opencl, 0, sizeof(nvidia_opencl)); nvidia_opencl.clear();
retval = nvidia_opencl.parse(xp, "/nvidia_opencl"); retval = nvidia_opencl.parse(xp, "/nvidia_opencl");
if (retval) { if (retval) {
memset(&nvidia_opencl, 0, sizeof(nvidia_opencl)); nvidia_opencl.clear();
} else { } else {
nvidia_opencl.is_used = COPROC_IGNORED; nvidia_opencl.is_used = COPROC_IGNORED;
nvidia_opencls.push_back(nvidia_opencl); nvidia_opencls.push_back(nvidia_opencl);
...@@ -543,10 +543,10 @@ int COPROCS::read_coproc_info_file(vector<string> &warnings) { ...@@ -543,10 +543,10 @@ int COPROCS::read_coproc_info_file(vector<string> &warnings) {
} }
if (xp.match_tag("intel_gpu_opencl")) { if (xp.match_tag("intel_gpu_opencl")) {
memset(&intel_gpu_opencl, 0, sizeof(intel_gpu_opencl)); intel_gpu_opencl.clear();
retval = intel_gpu_opencl.parse(xp, "/intel_gpu_opencl"); retval = intel_gpu_opencl.parse(xp, "/intel_gpu_opencl");
if (retval) { if (retval) {
memset(&intel_gpu_opencl, 0, sizeof(intel_gpu_opencl)); intel_gpu_opencl.clear();
} else { } else {
intel_gpu_opencl.is_used = COPROC_IGNORED; intel_gpu_opencl.is_used = COPROC_IGNORED;
intel_gpu_opencls.push_back(intel_gpu_opencl); intel_gpu_opencls.push_back(intel_gpu_opencl);
...@@ -555,10 +555,10 @@ int COPROCS::read_coproc_info_file(vector<string> &warnings) { ...@@ -555,10 +555,10 @@ int COPROCS::read_coproc_info_file(vector<string> &warnings) {
} }
if (xp.match_tag("other_opencl")) { if (xp.match_tag("other_opencl")) {
memset(&other_opencl, 0, sizeof(other_opencl)); other_opencl.clear();
retval = other_opencl.parse(xp, "/other_opencl"); retval = other_opencl.parse(xp, "/other_opencl");
if (retval) { if (retval) {
memset(&other_opencl, 0, sizeof(other_opencl)); other_opencl.clear();
} else { } else {
other_opencl.is_used = COPROC_USED; other_opencl.is_used = COPROC_USED;
other_opencls.push_back(other_opencl); other_opencls.push_back(other_opencl);
...@@ -567,10 +567,10 @@ int COPROCS::read_coproc_info_file(vector<string> &warnings) { ...@@ -567,10 +567,10 @@ int COPROCS::read_coproc_info_file(vector<string> &warnings) {
} }
if (xp.match_tag("opencl_cpu_prop")) { if (xp.match_tag("opencl_cpu_prop")) {
memset(&cpu_opencl, 0, sizeof(cpu_opencl)); cpu_opencl.clear();
retval = cpu_opencl.parse(xp); retval = cpu_opencl.parse(xp);
if (retval) { if (retval) {
memset(&cpu_opencl, 0, sizeof(cpu_opencl)); cpu_opencl.clear();
} else { } else {
cpu_opencl.opencl_prop.is_used = COPROC_IGNORED; cpu_opencl.opencl_prop.is_used = COPROC_IGNORED;
cpu_opencls.push_back(cpu_opencl); cpu_opencls.push_back(cpu_opencl);
......
...@@ -392,7 +392,7 @@ void* cudalib = NULL; ...@@ -392,7 +392,7 @@ void* cudalib = NULL;
warnings.push_back(buf); warnings.push_back(buf);
for (j=0; j<cuda_ndevs; j++) { for (j=0; j<cuda_ndevs; j++) {
memset(&cc.prop, 0, sizeof(cc.prop)); cc.prop.clear();
CUdevice device; CUdevice device;
retval = (*p_cuDeviceGet)(&device, j); retval = (*p_cuDeviceGet)(&device, j);
if (retval) { if (retval) {
......
...@@ -320,7 +320,7 @@ void COPROCS::get_opencl( ...@@ -320,7 +320,7 @@ void COPROCS::get_opencl(
} }
for (device_index=0; device_index<num_devices; ++device_index) { for (device_index=0; device_index<num_devices; ++device_index) {
memset(&prop, 0, sizeof(prop)); prop.clear();
prop.device_id = devices[device_index]; prop.device_id = devices[device_index];
strlcpy( strlcpy(
prop.opencl_platform_version, platform_version, prop.opencl_platform_version, platform_version,
...@@ -406,7 +406,7 @@ void COPROCS::get_opencl( ...@@ -406,7 +406,7 @@ void COPROCS::get_opencl(
} }
for (device_index=0; device_index<num_devices; ++device_index) { for (device_index=0; device_index<num_devices; ++device_index) {
memset(&prop, 0, sizeof(prop)); prop.clear();
prop.device_id = devices[device_index]; prop.device_id = devices[device_index];
strlcpy( strlcpy(
prop.opencl_platform_version, platform_version, prop.opencl_platform_version, platform_version,
......
...@@ -1545,7 +1545,7 @@ vector<AUTH_INFO> auth_infos; ...@@ -1545,7 +1545,7 @@ vector<AUTH_INFO> auth_infos;
// check HTTP authentication info // check HTTP authentication info
// //
bool valid_auth(int id, long seqno, char* hash, char* request) { bool valid_auth(int id, long seqno, char* hash, char* request) {
char buf[256], my_hash[256]; char buf[1024], my_hash[256];
//printf("valid_auth: id %d seqno %ld hash %s\n", id, seqno, hash); //printf("valid_auth: id %d seqno %ld hash %s\n", id, seqno, hash);
for (unsigned int i=0; i<auth_infos.size(); i++) { for (unsigned int i=0; i<auth_infos.size(); i++) {
AUTH_INFO& ai = auth_infos[i]; AUTH_INFO& ai = auth_infos[i];
......
...@@ -1580,7 +1580,7 @@ static const struct dir_tty_dev { ...@@ -1580,7 +1580,7 @@ static const struct dir_tty_dev {
vector<string> get_tty_list() { vector<string> get_tty_list() {
// Create a list of all terminal devices on the system. // Create a list of all terminal devices on the system.
char devname[1024]; char devname[1024];
char fullname[1024]; char fullname[MAXPATHLEN];
int done,i=0; int done,i=0;
vector<string> tty_list; vector<string> tty_list;
...@@ -1594,7 +1594,7 @@ vector<string> get_tty_list() { ...@@ -1594,7 +1594,7 @@ vector<string> get_tty_list() {
if (!done && (strstr(devname,tty_patterns[i].dev) == devname)) { if (!done && (strstr(devname,tty_patterns[i].dev) == devname)) {
// don't add anything starting with . // don't add anything starting with .
if (devname[0] != '.') { if (devname[0] != '.') {
sprintf(fullname,"%s/%s",tty_patterns[i].dir,devname); sprintf(fullname,"%s/%s", tty_patterns[i].dir, devname);
tty_list.push_back(fullname); tty_list.push_back(fullname);
} }
} }
......
...@@ -76,7 +76,7 @@ static void get_user_agent_string() { ...@@ -76,7 +76,7 @@ static void get_user_agent_string() {
BOINC_MAJOR_VERSION, BOINC_MINOR_VERSION, BOINC_RELEASE BOINC_MAJOR_VERSION, BOINC_MINOR_VERSION, BOINC_RELEASE
); );
if (strlen(gstate.client_brand)) { if (strlen(gstate.client_brand)) {
char buf[256]; char buf[1024];
snprintf(buf, sizeof(buf), " (%s)", gstate.client_brand); snprintf(buf, sizeof(buf), " (%s)", gstate.client_brand);
safe_strcat(g_user_agent_string, buf); safe_strcat(g_user_agent_string, buf);
} }
......
...@@ -60,7 +60,7 @@ public: ...@@ -60,7 +60,7 @@ public:
char m_url[1024]; char m_url[1024];
char m_curl_ca_bundle_location[256]; char m_curl_ca_bundle_location[256];
// string needed for ssl support // string needed for ssl support
char m_curl_user_credentials[128]; char m_curl_user_credentials[1024];
// string needed for proxy username/password // string needed for proxy username/password
int content_length; int content_length;
......
...@@ -158,7 +158,7 @@ void log_message_error(const char* msg, int error_code) { ...@@ -158,7 +158,7 @@ void log_message_error(const char* msg, int error_code) {
} }
#ifndef _WIN32 #ifndef _WIN32
static void signal_handler(int signum) { static void signal_handler(int signum, siginfo_t*, void*) {
msg_printf(NULL, MSG_INFO, "Received signal %d", signum); msg_printf(NULL, MSG_INFO, "Received signal %d", signum);
switch(signum) { switch(signum) {
case SIGHUP: case SIGHUP:
......
...@@ -51,11 +51,6 @@ ...@@ -51,11 +51,6 @@
DAILY_XFER_HISTORY daily_xfer_history;