Bernhard Übelacker : attrib: Avoid crash when called without parameter.

Alexandre Julliard julliard at winehq.org
Fri Feb 25 07:30:25 CST 2022


Module: wine
Branch: oldstable
Commit: d2392af66487fccb795e0a671aac06d41dc5c39c
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=d2392af66487fccb795e0a671aac06d41dc5c39c

Author: Bernhard Übelacker <bernhardu at mailbox.org>
Date:   Wed Sep  8 14:55:43 2021 +0200

attrib: Avoid crash when called without parameter.

If attrib is called without any parameter the variable originalname
is used uninitialized.

Signed-off-by: Bernhard Übelacker <bernhardu at mailbox.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 5ec15243266b19970875770da1576d826d0be7a5)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 programs/attrib/attrib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/programs/attrib/attrib.c b/programs/attrib/attrib.c
index 4813443449b..13fedad4e34 100644
--- a/programs/attrib/attrib.c
+++ b/programs/attrib/attrib.c
@@ -252,7 +252,7 @@ int __cdecl wmain(int argc, WCHAR *argv[])
     }
 
     /* By default all files from current directory are taken into account */
-    lstrcpyW(name, L"*");
+    lstrcpyW(originalname, L".\\*");
 
     while (i < argc) {
         WCHAR *param = argv[i++];




More information about the wine-cvs mailing list