[newlib-cygwin] tzset: Fix array length given to GetGeoInfoW
Corinna Vinschen
corinna@sourceware.org
Sun Oct 23 14:45:00 GMT 2016
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=cf01b8f0290eacb35d2c5206b25d3b5968706445
commit cf01b8f0290eacb35d2c5206b25d3b5968706445
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Sun Oct 23 16:45:21 2016 +0200
tzset: Fix array length given to GetGeoInfoW
Fixes Coverity CID 66916
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
winsup/utils/tzset.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/winsup/utils/tzset.c b/winsup/utils/tzset.c
index 02ac5f3..b7fd1ae 100644
--- a/winsup/utils/tzset.c
+++ b/winsup/utils/tzset.c
@@ -195,7 +195,7 @@ main (int argc, char **argv)
*country = L'\0';
geo = GetUserGeoID (GEOCLASS_NATION);
if (geo != GEOID_NOT_AVAILABLE)
- GetGeoInfoW (geo, GEO_ISO2, country, sizeof country, 0);
+ GetGeoInfoW (geo, GEO_ISO2, country, sizeof country / sizeof (*country), 0);
/* If, for some reason, the Geo-location isn't available, we use the locale
setting instead. */
if (!*country)
More information about the Cygwin-cvs
mailing list