[ros-diffs] [jmorlan] 35671: Prohibit an empty name in RtlSetEnvironmentVariable

jmorlan at svn.reactos.org jmorlan at svn.reactos.org
Tue Aug 26 16:45:37 CEST 2008


Author: jmorlan
Date: Tue Aug 26 09:45:37 2008
New Revision: 35671

URL: http://svn.reactos.org/svn/reactos?rev=35671&view=rev
Log:
Prohibit an empty name in RtlSetEnvironmentVariable

Modified:
    trunk/reactos/lib/rtl/env.c

Modified: trunk/reactos/lib/rtl/env.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/env.c?rev=35671&r1=35670&r2=35671&view=diff
==============================================================================
--- trunk/reactos/lib/rtl/env.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/env.c [iso-8859-1] Tue Aug 26 09:45:37 2008
@@ -282,6 +282,10 @@
    DPRINT("RtlSetEnvironmentVariable(Environment %p Name %wZ Value %wZ)\n",
           Environment, Name, Value);
 
+   /* Variable name must not be empty */
+   if (Name->Length < sizeof(WCHAR))
+      return STATUS_INVALID_PARAMETER;
+
    /* Variable names can't contain a '=' except as a first character. */
    for (wcs = Name->Buffer + 1;
         wcs < Name->Buffer + (Name->Length / sizeof(WCHAR));



More information about the Ros-diffs mailing list