Fix buffer overflow in lstrcpynW and lstrcpynA.
authorFilip Navara <filip.navara@gmail.com>
Sun, 21 Aug 2005 15:51:23 +0000 (15:51 +0000)
committerFilip Navara <filip.navara@gmail.com>
Sun, 21 Aug 2005 15:51:23 +0000 (15:51 +0000)
svn path=/trunk/; revision=17463

reactos/lib/kernel32/string/lstring.c

index 063ee03..edb6a4c 100644 (file)
@@ -91,10 +91,9 @@ lstrcpynA(
 
       do
         {
-          if ('\0' == (*d++ = *s++))
-            {
-              break;
-            }
+          if ('\0' == *s)
+            break;
+          *d++ = *s++;
         }
       while(1 != --iMaxLength);
       *d = '\0';
@@ -239,10 +238,9 @@ lstrcpynW(
 
       do
         {
-          if (L'\0' == (*d++ = *s++))
-            {
-              break;
-            }
+          if (L'\0' == *s)
+            break;
+          *d++ = *s++;
         }
       while(1 != --iMaxLength);
       *d = L'\0';