Re: Secure filename copy to fixed size variable wfileName
22 Apr
2008
22 Apr
'08
3:39 a.m.
"Tomasz Jezierski - Tefnet" <developers(a)tefnet.pl> wrote:
- strcpyW(wfileName, sei_tmp.lpFile); + StrCpyNW(wfileName, sei_tmp.lpFile,sizeof(wfileName)); } } else - strcpyW(wfileName, sei_tmp.lpFile); + StrCpyNW(wfileName, sei_tmp.lpFile,sizeof(wfileName));
Your patch doesn't make the code more secure than it is now. StrCpyNW takes number of characters, not bytes. And since it's just a wrapper around lstrcpynW it's better to use the latter one instead. -- Dmitry.
6533
Age (days ago)
6533
Last active (days ago)
0 comments
1 participants
participants (1)
-
Dmitry Timoshkov