mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 21:08:08 +01:00
util: replaced sprintf with snprintf to avoid buffer overflow (Coverity #50220)
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
36ac3b3344
commit
8e9c06627d
@@ -121,7 +121,10 @@ int main(int argc, char **argv)
|
||||
file = fopen(filename, "rb");
|
||||
if (!file) {
|
||||
char line[1024];
|
||||
sprintf(line, "%s: could not open \"%s\"", __progname, filename);
|
||||
|
||||
snprintf(line, sizeof(line),
|
||||
"%s: could not open \"%s\"",
|
||||
__progname, filename);
|
||||
perror(line);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user