]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Use c_toupper to avoid converting characters non in the english ASCII set. Reported...
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 5 May 2011 20:17:28 +0000 (22:17 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 5 May 2011 20:17:28 +0000 (22:17 +0200)
lib/gnutls_str.c
lib/opencdk/misc.c

index c2d53e5adc28516c34555385b854ebf8d7f99886..eec1ed1def968457904d48a619145c5c06e164fa 100644 (file)
@@ -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),
@@ -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--)
     ;
 
index d6a89aeb86b6794d21db7aa698c7a58e16c32167..d00aa95372918b2ad8c3a109bbe78f1c8b62589b 100644 (file)
@@ -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;