WUtil: rewrote wcopy_file for better error handling and to fix Coverity #50234
commit155e1f1fe1baf84c0f01eb6851cea24264a2bc73
authorChristophe CURIS <christophe.curis@free.fr>
Sat, 15 Nov 2014 18:40:30 +0000 (15 19:40 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Sun, 23 Nov 2014 22:42:18 +0000 (23 22:42 +0000)
treeed3228b049a95cefa2b4858ebf3d63b768b3dd2c
parent662b83769a7862a649315803468f16108c62dfdd
WUtil: rewrote wcopy_file for better error handling and to fix Coverity #50234

The original code used the libc "fopen" kind of operation, which are handy
when manipulating text files, but:
 - bring an overhead for binary files that we don't need here;
 - does not provide the mechanisms for safe error handling and special cases

As Coverity reported a Time-of-Check/Time-of-Use type of security issue,
took the opportunity to fix it and increased the size of the buffer used
for data to allow better use of modern disk performances.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
WINGs/findfile.c