mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 02:42:50 +00:00
kcontrol: zero-initialize the readlink() buffer in getSize() function
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
8714c4cd5f
commit
6aa200787a
1 changed files with 2 additions and 4 deletions
|
@ -116,10 +116,8 @@ static int getSize(const QString &file)
|
|||
if (S_ISLNK(buff.st_mode))
|
||||
{
|
||||
char buffer2[1000];
|
||||
int n=readlink(f.constData(), buffer2, 999);
|
||||
if(n!= -1)
|
||||
buffer2[n]='\0';
|
||||
|
||||
::memset(buffer2, 0, 1000 * sizeof(char));
|
||||
readlink(f.constData(), buffer2, 999);
|
||||
if(-1==KDE_stat(f.constData(), &buff))
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue