From: Nikos Mavrogiannopoulos Date: Thu, 5 May 2011 20:17:28 +0000 (+0200) Subject: Use c_toupper to avoid converting characters non in the english ASCII set. Reported... X-Git-Tag: gnutls_2_99_2~99 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=12c03890ea08be56536c1c8ea70b19d8a8137564;p=thirdparty%2Fgnutls.git Use c_toupper to avoid converting characters non in the english ASCII set. Reported by Kalle Olavi Niemitalo. --- diff --git a/lib/gnutls_str.c b/lib/gnutls_str.c index c2d53e5adc..eec1ed1def 100644 --- a/lib/gnutls_str.c +++ b/lib/gnutls_str.c @@ -28,6 +28,7 @@ #include #include #include +#include /* These function are like strcat, strcpy. They only * do bound checking (they shouldn't cause buffer overruns), @@ -536,7 +537,7 @@ _gnutls_hostname_compare (const char *certname, size_t certnamesize, const char *hostname) { /* find the first different character */ - for (; *certname && *hostname && toupper (*certname) == toupper (*hostname); + for (; *certname && *hostname && c_toupper (*certname) == c_toupper (*hostname); certname++, hostname++, certnamesize--) ; diff --git a/lib/opencdk/misc.c b/lib/opencdk/misc.c index d6a89aeb86..d00aa95372 100644 --- a/lib/opencdk/misc.c +++ b/lib/opencdk/misc.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "opencdk.h" #include "main.h" @@ -113,10 +114,10 @@ _cdk_memistr (const char *buf, size_t buflen, const char *sub) for (t = (byte *) buf, n = buflen, s = (byte *) sub; n; t++, n--) { - if (toupper (*t) == toupper (*s)) + if (c_toupper (*t) == c_toupper (*s)) { for (buf = t++, buflen = n--, s++; - n && toupper (*t) == toupper ((byte) * s); t++, s++, n--) + n && c_toupper (*t) == c_toupper ((byte) * s); t++, s++, n--) ; if (!*s) return buf;