diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-05-05 22:17:28 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-05-05 22:34:00 +0200 |
commit | 777aa2927b7d9238e505fd2cfc0e616cce60f9e8 (patch) | |
tree | 06d8f1dade04edb727d37d4eeff0cf3ca1290f53 | |
parent | 83ff33e7fdc369b8d4030f78633a6e279c51425f (diff) | |
download | gnutls-777aa2927b7d9238e505fd2cfc0e616cce60f9e8.tar.gz |
Use c_toupper to avoid converting characters non in the english ASCII set. Reported by Kalle Olavi Niemitalo.
-rw-r--r-- | lib/gnutls_str.c | 3 | ||||
-rw-r--r-- | lib/opencdk/misc.c | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/gnutls_str.c b/lib/gnutls_str.c index 4b6fc634bd..f0bc694352 100644 --- a/lib/gnutls_str.c +++ b/lib/gnutls_str.c @@ -28,6 +28,7 @@ #include <gnutls_num.h> #include <gnutls_str.h> #include <stdarg.h> +#include <c-ctype.h> /* These function are like strcat, strcpy. They only * do bound checking (they shouldn't cause buffer overruns), @@ -527,7 +528,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 <string.h> #include <ctype.h> #include <sys/stat.h> +#include <c-ctype.h> #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; |