lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri, 24 Apr 2015 20:45:42 -0400
From:	Mike Frysinger <vapier@...too.org>
To:	YOSHIFUJI Hideaki <yoshfuji@...ux-ipv6.org>
Cc:	netdev@...r.kernel.org,
	David Heidelberger <david.heidelberger@...t.cz>
Subject: [PATCH iputils] ping: fix -i number parsing in locales

Always use #.# format for the -i flag even when the current locale uses
a different separator.  Locale de_DE which uses #,# normally.

Simple testcase:
$ make USE_IDN=1
$ LANG=de_DE.UTF8 ./ping -i 0.5 localhost

Reported-by: Sergey Fionov <fionov@...il.com>
Signed-off-by: Mike Frysinger <vapier@...too.org>
---
 ping_common.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/ping_common.c b/ping_common.c
index 62f53a6..0a37e09 100644
--- a/ping_common.c
+++ b/ping_common.c
@@ -269,9 +269,17 @@ void common_options(int ch)
 		double dbl;
 		char *ep;
 
+#ifdef USE_IDN
+		setlocale(LC_ALL, "C");
+#endif
+
 		errno = 0;
 		dbl = strtod(optarg, &ep);
 
+#ifdef USE_IDN
+		setlocale(LC_ALL, "");
+#endif
+
 		if (errno || *ep != '\0' ||
 		    !finite(dbl) || dbl < 0.0 || dbl >= (double)INT_MAX / 1000 - 1.0) {
 			fprintf(stderr, "ping: bad timing interval\n");
-- 
2.3.5

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists