Author: tfaber
Date: Wed Oct 14 07:24:09 2015
New Revision: 69521
URL:
http://svn.reactos.org/svn/reactos?rev=69521&view=rev
Log:
[PING]
- Check for invalid values passed to the -n option. Patch by Tim Crawford
CORE-10332 #resolve
Modified:
trunk/reactos/base/applications/network/ping/lang/bg-BG.rc
trunk/reactos/base/applications/network/ping/lang/cs-CZ.rc
trunk/reactos/base/applications/network/ping/lang/de-DE.rc
trunk/reactos/base/applications/network/ping/lang/en-US.rc
trunk/reactos/base/applications/network/ping/lang/es-ES.rc
trunk/reactos/base/applications/network/ping/lang/fr-FR.rc
trunk/reactos/base/applications/network/ping/lang/it-IT.rc
trunk/reactos/base/applications/network/ping/lang/pl-PL.rc
trunk/reactos/base/applications/network/ping/lang/ro-RO.rc
trunk/reactos/base/applications/network/ping/lang/ru-RU.rc
trunk/reactos/base/applications/network/ping/lang/sq-AL.rc
trunk/reactos/base/applications/network/ping/lang/sv-SE.rc
trunk/reactos/base/applications/network/ping/lang/tr-TR.rc
trunk/reactos/base/applications/network/ping/lang/uk-UA.rc
trunk/reactos/base/applications/network/ping/lang/zh-CN.rc
trunk/reactos/base/applications/network/ping/ping.c
trunk/reactos/base/applications/network/ping/resource.h
Modified: trunk/reactos/base/applications/network/ping/lang/bg-BG.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ping/lang/bg-BG.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ping/lang/bg-BG.rc [iso-8859-1] Wed Oct 14
07:24:09 2015
@@ -31,6 +31,7 @@
IDS_BAD_OPTION_FORMAT "ÐепÑавилно запиÑване на
вÑзможноÑÑÑа %1.\n\0"
IDS_BAD_OPTION "ÐепÑавилна ÑÑойноÑÑ %1.\n\0"
IDS_BAD_VALUE_OPTION_L "ÐепÑавилна ÑÑойноÑÑ Ð·Ð° -l,
допÑÑÑимиÑе Ñа Ð¾Ñ 0 до %1!d!.\n\0"
+ IDS_BAD_VALUE_OPTION_N "ÐепÑавилна ÑÑойноÑÑ Ð·Ð° -n,
допÑÑÑимиÑе Ñа Ð¾Ñ 1 до %1!u!.\n\0"
IDS_REPLY_FROM "ÐÑÐ³Ð¾Ð²Ð¾Ñ Ð¾Ñ %1: байÑа=%2!d! вÑеме%3%4
ÐÐ(TTL)=%5!d!\n\0"
IDS_DEST_UNREACHABLE "Ð¦ÐµÐ»ÐµÐ²Ð¸Ñ Ð¿Ñиемник е
недоÑÑижим.\n\0"
IDS_COULD_NOT_TRANSMIT "ÐÑеÑка пÑи пÑедаване на
данниÑе (%1!d!).\n\0"
Modified: trunk/reactos/base/applications/network/ping/lang/cs-CZ.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ping/lang/cs-CZ.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ping/lang/cs-CZ.rc [iso-8859-1] Wed Oct 14
07:24:09 2015
@@ -30,6 +30,7 @@
IDS_BAD_OPTION_FORMAT "Nesprávný formát volby %1.\n\0"
IDS_BAD_OPTION "Nesprávná volba %1.\n\0"
IDS_BAD_VALUE_OPTION_L "Nesprávná hodnota volby -l, platný rozsah je od 0 do
%1!d!.\n\0"
+ IDS_BAD_VALUE_OPTION_N "Nesprávná hodnota volby -n, platný rozsah je od 1 do
%1!u!.\n\0"
IDS_REPLY_FROM "OdpovÄÄ od %1: bajtů=%2!d! Äas%3%4 TTL=%5!d!\n\0"
IDS_DEST_UNREACHABLE "CÃl je nedostupný.\n\0"
IDS_COULD_NOT_TRANSMIT "Nebylo možné pÅenést data (%1!d!).\n\0"
Modified: trunk/reactos/base/applications/network/ping/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ping/lang/de-DE.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ping/lang/de-DE.rc [iso-8859-1] Wed Oct 14
07:24:09 2015
@@ -25,6 +25,7 @@
IDS_BAD_OPTION_FORMAT "Ungültiges Format %1.\n\0"
IDS_BAD_OPTION "Ungültige Option %1.\n\0"
IDS_BAD_VALUE_OPTION_L "Ungültiger Wert für Option -l, Erlaubter Bereich ist
von 0 bis %1!d!.\n\0"
+ IDS_BAD_VALUE_OPTION_N "Ungültiger Wert für Option -n, Erlaubter Bereich ist
von 1 bis %1!u!.\n\0"
IDS_REPLY_FROM "Antwort von %1: bytes=%2!d! time%3%4 TTL=%5!d!\n\0"
IDS_DEST_UNREACHABLE "Zielhost nicht erreichbar.\n\0"
IDS_COULD_NOT_TRANSMIT "Es konnten keine Daten gesendet werden
(%1!d!).\n\0"
Modified: trunk/reactos/base/applications/network/ping/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ping/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ping/lang/en-US.rc [iso-8859-1] Wed Oct 14
07:24:09 2015
@@ -25,6 +25,7 @@
IDS_BAD_OPTION_FORMAT "Bad option format %1.\n\0"
IDS_BAD_OPTION "Bad option %1.\n\0"
IDS_BAD_VALUE_OPTION_L "Bad value for option -l, valid range is from 0 to
%1!d!.\n\0"
+ IDS_BAD_VALUE_OPTION_N "Bad value for option -n, valid range is from 1 to
%1!u!.\n\0"
IDS_REPLY_FROM "Reply from %1: bytes=%2!d! time%3%4 TTL=%5!d!\n\0"
IDS_DEST_UNREACHABLE "Destination host unreachable.\n\0"
IDS_COULD_NOT_TRANSMIT "Could not transmit data (%1!d!).\n\0"
Modified: trunk/reactos/base/applications/network/ping/lang/es-ES.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ping/lang/es-ES.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ping/lang/es-ES.rc [iso-8859-1] Wed Oct 14
07:24:09 2015
@@ -28,6 +28,7 @@
IDS_BAD_OPTION_FORMAT "El formato de opción %1 no es válido.\n\0"
IDS_BAD_OPTION "La opción %1 no es válida.\n\0"
IDS_BAD_VALUE_OPTION_L "El valor para la opción -l no es válido, debe de estar
entre 0 y %1!d!.\n\0"
+ IDS_BAD_VALUE_OPTION_N "El valor para la opción -n no es válido, debe de estar
entre 1 y %1!u!.\n\0"
IDS_REPLY_FROM "Respuesta desde %1: bytes=%2!d! tiempo%3%4 TTL=%5!d!\n\0"
IDS_DEST_UNREACHABLE "Host de destino inaccesible.\n\0"
IDS_COULD_NOT_TRANSMIT "No se ha podido transmitir ningún dato
(%1!d!).\n\0"
Modified: trunk/reactos/base/applications/network/ping/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ping/lang/fr-FR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ping/lang/fr-FR.rc [iso-8859-1] Wed Oct 14
07:24:09 2015
@@ -25,6 +25,7 @@
IDS_BAD_OPTION_FORMAT "Format d'option incorrect %1.\n\0"
IDS_BAD_OPTION "Option incorrecte %1.\n\0"
IDS_BAD_VALUE_OPTION_L "Valeur incorrecte pour l'option -l, elle doit être
entre 0 et %1!d!.\n\0"
+ IDS_BAD_VALUE_OPTION_N "Valeur incorrecte pour l'option -n, elle doit être
entre 1 et %1!u!.\n\0"
IDS_REPLY_FROM "Réponse de %1 : octets=%2!d! durée%3%4 TTL=%5!d!\n\0"
IDS_DEST_UNREACHABLE "Hôte de destination injoignable.\n\0"
IDS_COULD_NOT_TRANSMIT "Ãchec lors de la transmission (%1!d!).\n\0"
Modified: trunk/reactos/base/applications/network/ping/lang/it-IT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ping/lang/it-IT.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ping/lang/it-IT.rc [iso-8859-1] Wed Oct 14
07:24:09 2015
@@ -25,6 +25,7 @@
IDS_BAD_OPTION_FORMAT "Formato opzione errato %1.\n\0"
IDS_BAD_OPTION "Opzione errata %1.\n\0"
IDS_BAD_VALUE_OPTION_L "Valore errato per il parametro -l, è valido un valore
tra 0 to %1!d!.\n\0"
+ IDS_BAD_VALUE_OPTION_N "Valore errato per il parametro -n, è valido un valore
tra 1 to %1!u!.\n\0"
IDS_REPLY_FROM "Risposta da %1: bytes=%2!d! time%3%4 TTL=%5!d!\n\0"
IDS_DEST_UNREACHABLE "Host destinazione irraggiungibile.\n\0"
IDS_COULD_NOT_TRANSMIT "Impossibile trasmettere dati (%1!d!).\n\0"
Modified: trunk/reactos/base/applications/network/ping/lang/pl-PL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ping/lang/pl-PL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ping/lang/pl-PL.rc [iso-8859-1] Wed Oct 14
07:24:09 2015
@@ -33,6 +33,7 @@
IDS_BAD_OPTION_FORMAT "NieprawidÅowy format opcji %1.\n\0"
IDS_BAD_OPTION "NieprawidÅowa opcja %1.\n\0"
IDS_BAD_VALUE_OPTION_L "NieprawidÅowa wartoÅÄ dla opcji -l, wymagana liczba
naturalna od 0 do %1!d!.\n\0"
+ IDS_BAD_VALUE_OPTION_N "NieprawidÅowa wartoÅÄ dla opcji -n, wymagana liczba
naturalna od 1 do %1!u!.\n\0"
IDS_REPLY_FROM "Odpowiedź z %1: bajtów=%2!d! czas%3%4 TTL=%5!d!\n\0"
IDS_DEST_UNREACHABLE "Host docelowy nieosiÄ
galny.\n\0"
IDS_COULD_NOT_TRANSMIT "BÅÄ
d podczas transmisji danych (%1!d!).\n\0"
Modified: trunk/reactos/base/applications/network/ping/lang/ro-RO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ping/lang/ro-RO.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ping/lang/ro-RO.rc [iso-8859-1] Wed Oct 14
07:24:09 2015
@@ -34,6 +34,7 @@
IDS_BAD_OPTION_FORMAT "OpÈiune cu format eronat: %1.\n\0"
IDS_BAD_OPTION "%1 este o opÈiune eronatÄ.\n\0"
IDS_BAD_VALUE_OPTION_L "Valoare eronatÄ pentru opÈiunea -l, domeniul valid
este 0 - %1!d!.\n\0"
+ IDS_BAD_VALUE_OPTION_N "Valoare eronatÄ pentru opÈiunea -n, domeniul valid
este 1 - %1!u!.\n\0"
IDS_REPLY_FROM "RÄspuns de la %1: octeÈi=%2!d! timp%3%4 TTL=%5!d!\n\0"
IDS_DEST_UNREACHABLE "Gazda destinaÈie este inaccesibilÄ.\n\0"
IDS_COULD_NOT_TRANSMIT "Nu s-a reuÈit transmiterea datelor (%1!d!).\n\0"
Modified: trunk/reactos/base/applications/network/ping/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ping/lang/ru-RU.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ping/lang/ru-RU.rc [iso-8859-1] Wed Oct 14
07:24:09 2015
@@ -25,6 +25,7 @@
IDS_BAD_OPTION_FORMAT "Bad option format %1.\n\0"
IDS_BAD_OPTION "Bad option %1.\n\0"
IDS_BAD_VALUE_OPTION_L "ÐедопÑÑÑимое знаÑение
паÑамеÑÑа -l, допÑÑÑимÑй диапазон Ñ 0 по %1!d!.\n\0"
+ IDS_BAD_VALUE_OPTION_N "ÐедопÑÑÑимое знаÑение
паÑамеÑÑа -n, допÑÑÑимÑй диапазон Ñ 1 по %1!u!.\n\0"
IDS_REPLY_FROM "ÐÑÐ²ÐµÑ Ð¾Ñ %1: ÑиÑло байÑ=%2!d! вÑемÑ%3%4
TTL=%5!d!\n\0"
IDS_DEST_UNREACHABLE "Destination host unreachable.\n\0"
IDS_COULD_NOT_TRANSMIT "Could not transmit data (%1!d!).\n\0"
Modified: trunk/reactos/base/applications/network/ping/lang/sq-AL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ping/lang/sq-AL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ping/lang/sq-AL.rc [iso-8859-1] Wed Oct 14
07:24:09 2015
@@ -29,6 +29,7 @@
IDS_BAD_OPTION_FORMAT "Opsion formati i keq %1.\n\0"
IDS_BAD_OPTION "Opsion i keq %1.\n\0"
IDS_BAD_VALUE_OPTION_L "Vlere e keqe per opsion -l, varh i vlefshem nga 0 në
%1!d!.\n\0"
+ IDS_BAD_VALUE_OPTION_N "Vlere e keqe per opsion -n, varh i vlefshem nga 1 në
%1!u!.\n\0"
IDS_REPLY_FROM "Pergjigju nga %1: bytes=%2!d! time%3%4 TTL=%5!d!\n\0"
IDS_DEST_UNREACHABLE "Destinacioni i hostit i pakapshem.\n\0"
IDS_COULD_NOT_TRANSMIT "Nuk transmetoj dot data (%1!d!).\n\0"
Modified: trunk/reactos/base/applications/network/ping/lang/sv-SE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ping/lang/sv-SE.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ping/lang/sv-SE.rc [iso-8859-1] Wed Oct 14
07:24:09 2015
@@ -32,6 +32,7 @@
IDS_BAD_OPTION_FORMAT "Ogiltigt format på alternativ %1.\n\0"
IDS_BAD_OPTION "Ogiltigt alternativ %1.\n\0"
IDS_BAD_VALUE_OPTION_L "Ogiltigt värde för alternativ -l, giltig intervall är
från 0 till %1!d!.\n\0"
+ IDS_BAD_VALUE_OPTION_N "Ogiltigt värde för alternativ -n, giltig intervall är
från 1 till %1!u!.\n\0"
IDS_REPLY_FROM "Svar från %1: bytes=%2!d! tid%3%4 TTL=%5!d!\n\0"
IDS_DEST_UNREACHABLE "Värddatorn går inte att nå.\n\0"
IDS_COULD_NOT_TRANSMIT "Kunde inte sända data (%1!d!).\n\0"
Modified: trunk/reactos/base/applications/network/ping/lang/tr-TR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ping/lang/tr-TR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ping/lang/tr-TR.rc [iso-8859-1] Wed Oct 14
07:24:09 2015
@@ -27,6 +27,7 @@
IDS_BAD_OPTION_FORMAT "Geçersiz seçenek biçimi: %1.\n\0"
IDS_BAD_OPTION "Geçersiz seçenek: %1.\n\0"
IDS_BAD_VALUE_OPTION_L "-l seçeneÄi için deÄer geçersiz, geçerli aralık
0'dan %1!d! sayısına dektir.\n\0"
+ IDS_BAD_VALUE_OPTION_N "-n seçeneÄi için deÄer geçersiz, geçerli aralık
1'dan %1!u! sayısına dektir.\n\0"
IDS_REPLY_FROM "%1 varıÅından yanıt: çoklu=%2!d! süre=%3%4
TTL=%5!d!\n\0"
IDS_DEST_UNREACHABLE "VarıŠanabilgisayarı eriÅilemez.\n\0"
IDS_COULD_NOT_TRANSMIT "Veri gönderilemedi (%1!d!).\n\0"
Modified: trunk/reactos/base/applications/network/ping/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ping/lang/uk-UA.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ping/lang/uk-UA.rc [iso-8859-1] Wed Oct 14
07:24:09 2015
@@ -33,6 +33,7 @@
IDS_BAD_OPTION_FORMAT "ÐевÑÑний ÑоÑÐ¼Ð°Ñ Ð¾Ð¿ÑÑÑ %1.\n\0"
IDS_BAD_OPTION "Ðогана опÑÑÑ %1.\n\0"
IDS_BAD_VALUE_OPTION_L "ÐепÑавилÑне знаÑÐµÐ½Ð½Ñ Ð´Ð»Ñ
опÑÑÑ -l, допÑÑÑимий дÑапазон вÑд 0 до %1!d!.\n\0"
+ IDS_BAD_VALUE_OPTION_N "ÐепÑавилÑне знаÑÐµÐ½Ð½Ñ Ð´Ð»Ñ
опÑÑÑ -n, допÑÑÑимий дÑапазон вÑд 1 до %1!u!.\n\0"
IDS_REPLY_FROM "ÐÑдповÑÐ´Ñ Ð²Ñд %1: байÑÑв=%2!d! ÑаÑ%3%4
TTL=%5!d!\n\0"
IDS_DEST_UNREACHABLE "ХоÑÑ Ð½ÐµÐ´Ð¾ÑÑÑпний.\n\0"
IDS_COULD_NOT_TRANSMIT "Ðе вдалоÑÑ Ð¿ÐµÑедаÑи данÑ
(%1!d!).\n\0"
Modified: trunk/reactos/base/applications/network/ping/lang/zh-CN.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ping/lang/zh-CN.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ping/lang/zh-CN.rc [iso-8859-1] Wed Oct 14
07:24:09 2015
@@ -27,6 +27,7 @@
IDS_BAD_OPTION_FORMAT "é误éé¡¹æ ¼å¼ %1ã\n\0"
IDS_BAD_OPTION "é误é项 %1ã\n\0"
IDS_BAD_VALUE_OPTION_L "-l é项çå¼æ æï¼ææçèå´æ¯ä» 0 å°
%1!d!ã\n\0"
+ IDS_BAD_VALUE_OPTION_N "-n é项çå¼æ æï¼ææçèå´æ¯ä» 1 å°
%1!u!ã\n\0"
IDS_REPLY_FROM "æ¥èª %1 çåå¤ï¼åèæ°=%2!d! æ¶é´%3%4
TTL=%5!d!\n\0"
IDS_DEST_UNREACHABLE "ç®æ 主æºä¸å¯å°è¾¾ã\n\0"
IDS_COULD_NOT_TRANSMIT "æ æ³åéæ°æ® (%1!d!)ã\n\0"
Modified: trunk/reactos/base/applications/network/ping/ping.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ping/ping.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ping/ping.c [iso-8859-1] Wed Oct 14 07:24:09
2015
@@ -249,7 +249,15 @@
case L'a': ResolveAddresses = TRUE; break;
case L'n':
if (i + 1 < argc)
+ {
PingCount = wcstoul(argv[++i], NULL, 0);
+
+ if (PingCount == 0)
+ {
+ FormatOutput(IDS_BAD_VALUE_OPTION_N, UINT_MAX);
+ return FALSE;
+ }
+ }
else
InvalidOption = TRUE;
break;
Modified: trunk/reactos/base/applications/network/ping/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ping/resource.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ping/resource.h [iso-8859-1] Wed Oct 14
07:24:09 2015
@@ -23,3 +23,4 @@
#define IDS_REQUEST_TIMEOUT 20
#define IDS_MS 21
#define IDS_1MS 22
+#define IDS_BAD_VALUE_OPTION_N 23