use snprintf to prevent buffer overflow

fixes CID 27968 found by Coverity
This commit is contained in:
Christian Beer 2015-10-21 17:30:58 +02:00
parent 851412a5ec
commit 52f494ef98
1 changed files with 1 additions and 1 deletions

View File

@ -223,7 +223,7 @@ int handle_status(const char* name) {
int handle_update(const char* name) {
DB_VDA_FILE dvf;
char buf[1024];
sprintf(buf, "where file_name='%s'", name);
snprintf(buf, sizeof(buf), "where file_name='%s'", name);
int retval = dvf.lookup(buf);
if (retval) return retval;
return dvf.update_field("need_update=1");