Fix Bug 1217 with patch from bugzila by ravelo "If you type > or < in
cmd and hit ENTER, cmd.exe crashes"
Modified: trunk/reactos/subsys/system/cmd/cmd.c
_____
Modified: trunk/reactos/subsys/system/cmd/cmd.c
--- trunk/reactos/subsys/system/cmd/cmd.c 2005-12-29 21:45:17 UTC
(rev 20441)
+++ trunk/reactos/subsys/system/cmd/cmd.c 2005-12-29 21:46:40 UTC
(rev 20442)
@@ -1385,9 +1385,10 @@
tmp = commandline;
tmp += _tcsspn(tmp,_T(" \t"));
/* first we find and skip and
pre-redirections... */
- while ( _tcschr(_T("<>"),*tmp)
+ while (( tmp ) &&
+ ( _tcschr(_T("<>"),*tmp)
|| !_tcsncmp(tmp,_T("1>"),2)
- || !_tcsncmp(tmp,_T("2>"),2) )
+ || !_tcsncmp(tmp,_T("2>"),2) ))
{
if ( _istdigit(*tmp) )
tmp += 2;
@@ -1402,7 +1403,8 @@
}
else
tmp = _tcspbrk(tmp,_T(" \t"));
- tmp += _tcsspn(tmp,_T(" \t"));
+ if ( tmp )
+ tmp += _tcsspn(tmp,_T(" \t"));
}
/* we should now be pointing to the actual
command
* (if there is one yet)*/
do not call on NtQuerySecurityObject in RegGetKeySecurity for it will
always fail on reactos.
adding #ifndef __REACTOS__ around that code and should be remove when we
have that call implement in reactos.
Modified: trunk/reactos/lib/advapi32/reg/reg.c
_____
Modified: trunk/reactos/lib/advapi32/reg/reg.c
--- trunk/reactos/lib/advapi32/reg/reg.c 2005-12-29 20:51:14 UTC
(rev 20438)
+++ trunk/reactos/lib/advapi32/reg/reg.c 2005-12-29 21:01:51 UTC
(rev 20439)
@@ -2507,12 +2507,13 @@
TRACE("MapDefaultKey() failed (Status %lx)\n", Status);
return RtlNtStatusToDosError (Status);
}
-
+#ifndef __REACTOS__
Status = NtQuerySecurityObject(KeyHandle,
SecurityInformation,
pSecurityDescriptor,
*lpcbSecurityDescriptor,
lpcbSecurityDescriptor);
+#endif
ClosePredefKey(KeyHandle);