mirror of https://github.com/BOINC/boinc.git
use snprintf to prevent buffer overflow
fixes CID 27939 found by Coverity
This commit is contained in:
parent
145942cbb3
commit
e2508a0d36
|
@ -47,7 +47,7 @@ int main(int argc, char** argv) {
|
|||
if (!strcmp(argv[1], "--name")) {
|
||||
DB_WORKUNIT wu;
|
||||
char buf[256];
|
||||
sprintf(buf, "where name='%s'", argv[2]);
|
||||
snprintf(buf, sizeof(buf), "where name='%s'", argv[2]);
|
||||
retval = wu.lookup(buf);
|
||||
if (retval) {
|
||||
fprintf(stderr, "No workunit named '%s'\n", argv[2]);
|
||||
|
|
Loading…
Reference in New Issue