mirror of https://github.com/BOINC/boinc.git
use snprintf to prevent buffer overflow
fixes CID 27968 found by Coverity
This commit is contained in:
parent
851412a5ec
commit
52f494ef98
|
@ -223,7 +223,7 @@ int handle_status(const char* name) {
|
||||||
int handle_update(const char* name) {
|
int handle_update(const char* name) {
|
||||||
DB_VDA_FILE dvf;
|
DB_VDA_FILE dvf;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
sprintf(buf, "where file_name='%s'", name);
|
snprintf(buf, sizeof(buf), "where file_name='%s'", name);
|
||||||
int retval = dvf.lookup(buf);
|
int retval = dvf.lookup(buf);
|
||||||
if (retval) return retval;
|
if (retval) return retval;
|
||||||
return dvf.update_field("need_update=1");
|
return dvf.update_field("need_update=1");
|
||||||
|
|
Loading…
Reference in New Issue