[ros-bugs] [Bug 5611] PATCH: sc: Prevent crash command-line Service Control due to missing arguments

ReactOS.Bugzilla at reactos.org ReactOS.Bugzilla at reactos.org
Thu Sep 16 10:03:23 UTC 2010


http://www.reactos.org/bugzilla/show_bug.cgi?id=5611





--- Comment #5 from Ged <gedmurphy at reactos.org>  2010-09-16 10:03:23 CET ---
> if (!lstrcmpi(ServiceArgs[0], ..)) .. = ServiceArgs[1];
> if (!lstrcmpi(*ServiceArgs, ..)) .. = ServiceArgs[1];

The top looks cleaner until you do something like this:

while (ArgCount > 1)
{
    if (!lstrcmpi(ServiceArgs[0], ..))
...
    ServiceArgs += 2;
    ArgCount -= 2;
}

then it becomes confusing.
Either stick with pointer arithmitic/operators or array indices. 

The original app was hacked together as a test app for loosely testing the SCM
when it was early in its development. It's probably full of weirdness and was
never meant to be used as an actual ros application.
I eventually wrote servman for this purpose and always intended on rewriting sc
using the servman code.


-- 
Configure bugmail: http://www.reactos.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Ros-bugs mailing list