]> granicus.if.org Git - curl/commitdiff
x509asn1: Silence x64 loss-of-data warning on RSA key length assignment
authorJay Satiro <raysatiro@yahoo.com>
Sun, 5 Apr 2015 06:25:33 +0000 (02:25 -0400)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 6 Apr 2015 15:55:48 +0000 (17:55 +0200)
The key length in bits will always fit in an unsigned long so the
loss-of-data warning assigning the result of x64 pointer arithmetic to
an unsigned long is unnecessary.

lib/x509asn1.c

index e18218d3d34bbc5ba06db67309cd2c05dd4c90ab..a163568ed1f4635e3453a9f057ab263acebb120c 100644 (file)
@@ -820,7 +820,7 @@ static void do_pubkey(struct SessionHandle * data, int certnum,
     /* Compute key length. */
     for(q = elem.beg; !*q && q < elem.end; q++)
       ;
-    len = (elem.end - q) * 8;
+    len = (unsigned long)((elem.end - q) * 8);
     if(len)
       for(i = *(unsigned char *) q; !(i & 0x80); i <<= 1)
         len--;