Author: hbelusca
Date: Fri Sep 1 20:35:25 2017
New Revision: 75733
URL:
http://svn.reactos.org/svn/reactos?rev=75733&view=rev
Log:
[EVENTCREATE]: Use wcstoul() to retrieve and check for valid numerical values.
Modified:
trunk/reactos/base/applications/cmdutils/eventcreate/eventcreate.c
Modified: trunk/reactos/base/applications/cmdutils/eventcreate/eventcreate.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/eventcreate/eventcreate.c [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/cmdutils/eventcreate/eventcreate.c [iso-8859-1] Fri
Sep 1 20:35:25 2017
@@ -914,7 +914,18 @@
// case TYPE_U16:
case TYPE_U32:
{
- *(ULONG*)Options[Option].Value = (ULONG)_wtol(argv[i]);
+ PWCHAR pszNext = NULL;
+
+ /* The number is specified in base 10 */
+ // NOTE: We might use '0' so that the base is automatically
determined.
+ *(ULONG*)Options[Option].Value = wcstoul(argv[i], &pszNext, 10);
+ if (*pszNext)
+ {
+ /* The value is not a valid numeric value and is not allowed */
+ if (PrintErrorFunc)
+ PrintErrorFunc(InvalidValue, argv[i], OptionStr);
+ return FALSE;
+ }
break;
}