Author: hbelusca
Date: Wed Mar 8 22:34:01 2017
New Revision: 74133
URL:
http://svn.reactos.org/svn/reactos?rev=74133&view=rev
Log:
[CLT-2017]: The very last sync!
[SHUTDOWN]: shutdown -t causes crash. Patch by Michael Fritscher. (r74131 by Eric).
<@dreimer> OMG!!!!
<@hbelusca> hm dreimer?
<@dreimer> ITS SO IMPORTANT!!!!
<@hbelusca> ah you want it? <@hbelusca> ok <@hbelusca> let's add it
:D
<@dreimer> jkjkjk
Modified:
branches/ReactOS-0.4.4-CLT2017/reactos/ (props changed)
branches/ReactOS-0.4.4-CLT2017/reactos/base/applications/shutdown/shutdown.c
Propchange: branches/ReactOS-0.4.4-CLT2017/reactos/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Mar 8 22:34:01 2017
@@ -24,4 +24,4 @@
/branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859
/branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567
/branches/wlan-bringup:54809-54998
-/trunk/reactos:74083,74112,74117-74119
+/trunk/reactos:74083,74112,74117-74119,74131
Modified: branches/ReactOS-0.4.4-CLT2017/reactos/base/applications/shutdown/shutdown.c
URL:
http://svn.reactos.org/svn/reactos/branches/ReactOS-0.4.4-CLT2017/reactos/b…
==============================================================================
---
branches/ReactOS-0.4.4-CLT2017/reactos/base/applications/shutdown/shutdown.c [iso-8859-1]
(original)
+++
branches/ReactOS-0.4.4-CLT2017/reactos/base/applications/shutdown/shutdown.c [iso-8859-1]
Wed Mar 8 22:34:01 2017
@@ -56,12 +56,11 @@
break;
case L'c': /* Comment on reason for shutdown */
+ if (index+1 > argc)
+ return ERROR_INVALID_DATA;
if(CheckCommentLength(argv[index+1]))
{
- if (index+1 <= argc)
- pOpts->message = argv[index+1];
- else
- return ERROR_INVALID_DATA;
+ pOpts->message = argv[index+1];
index++;
}
else
@@ -72,10 +71,9 @@
break;
case L'd': /* Reason code [p|u:]xx:yy */
- if (index+1 <= argc)
- pOpts->reason = ParseReasonCode(argv[index+1]);
- else
+ if (index+1 >= argc)
return ERROR_INVALID_DATA;
+ pOpts->reason = ParseReasonCode(argv[index+1]);
index++;
break;
@@ -101,7 +99,10 @@
break;
case L'm': /* Target remote systems (UNC name/IP address) */
+ if (index+1 >= argc)
+ return ERROR_INVALID_DATA;
pOpts->remote_system = argv[index+1];
+ index++;
break;
case L'p': /* Turn off local computer with no warning/time-out
*/
@@ -118,9 +119,12 @@
break;
case L't': /* Shutdown delay */
+ if (index+1 >= argc)
+ return ERROR_INVALID_DATA;
pOpts->shutdown_delay = _wtoi(argv[index+1]);
if (pOpts->shutdown_delay > 0)
pOpts->force = TRUE;
+ index++;
break;
default: