Fix undefined behaviour in e_aes_cbc_hmac_sha256.c and e_aes_cbc_hmac_sha1.c
[oweals/openssl.git] / crypto / asn1 / a_strex.c
index fc9883be2b3149156627e234d568db57db501cfb..1bc06799afa9bef1ab3ded797e96065be15ee866 100644 (file)
@@ -455,9 +455,9 @@ static int do_name_ex(char_io *io_ch, void *arg, const X509_NAME *n,
     cnt = X509_NAME_entry_count(n);
     for (i = 0; i < cnt; i++) {
         if (flags & XN_FLAG_DN_REV)
-            ent = X509_NAME_get_entry((X509_NAME *)n, cnt - i - 1);
+            ent = X509_NAME_get_entry(n, cnt - i - 1);
         else
-            ent = X509_NAME_get_entry((X509_NAME *)n, i);
+            ent = X509_NAME_get_entry(n, i);
         if (prev != -1) {
             if (prev == X509_NAME_ENTRY_set(ent)) {
                 if (!io_ch(arg, sep_mv, sep_mv_len))
@@ -601,7 +601,7 @@ int asn1_valid_host(const ASN1_STRING *host)
     const unsigned char *hostptr = host->data;
     int type = host->type;
     int i;
-    char width = -1;
+    signed char width = -1;
     unsigned short chflags = 0, prevchflags;
 
     if (type > 0 && type < 31)