mirror of https://github.com/BOINC/boinc.git
use snprintf to prevent buffer overflow
fixes CID 27921, 28031 found by Coverity
This commit is contained in:
parent
b1806c2b77
commit
5c7cf964e5
|
@ -242,13 +242,13 @@ int main(int argc, char** argv) {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
sprintf(buf, "where name='%s'", app_name);
|
||||
snprintf(buf, sizeof(buf), "where name='%s'", app_name);
|
||||
if (app.lookup(buf)) {
|
||||
log_messages.printf(MSG_CRITICAL, "can't find app %s\n", app_name);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
sprintf(buf, "templates/%s", in_template_file);
|
||||
snprintf(buf, sizeof(buf), "templates/%s", in_template_file);
|
||||
if (read_file_malloc(config.project_path(buf), in_template)) {
|
||||
log_messages.printf(MSG_CRITICAL, "can't read input template %s\n", buf);
|
||||
exit(1);
|
||||
|
|
Loading…
Reference in New Issue