Commit in reactos/lib/advapi32/reg on MAIN
reg.c+9-21.66 -> 1.67
Don't write outside buffer

reactos/lib/advapi32/reg
reg.c 1.66 -> 1.67
diff -u -r1.66 -r1.67
--- reg.c	25 Dec 2004 11:18:50 -0000	1.66
+++ reg.c	26 Dec 2004 23:09:51 -0000	1.67
@@ -1,4 +1,4 @@
-/* $Id: reg.c,v 1.66 2004/12/25 11:18:50 navaraf Exp $
+/* $Id: reg.c,v 1.67 2004/12/26 23:09:51 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -2506,7 +2506,14 @@
 	}
       else if (ErrorCode == ERROR_SUCCESS && ValueData.Buffer != NULL)
 	{
-	  RtlMoveMemory(lpData, ValueData.Buffer, Length);
+          if (*lpcbData < Length)
+            {
+              ErrorCode = ERROR_MORE_DATA;
+            }
+          else
+            {
+              RtlMoveMemory(lpData, ValueData.Buffer, Length);
+            }
 	}
 
       if (lpcbData != NULL)
CVSspam 0.2.8