Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/netpgp/dist/src/libbn Fix some lint - fr...



details:   https://anonhg.NetBSD.org/src/rev/45b0f38dd3ac
branches:  trunk
changeset: 782830:45b0f38dd3ac
user:      agc <agc%NetBSD.org@localhost>
date:      Thu Nov 22 00:37:55 2012 +0000

description:
Fix some lint - from Havard Eidnes

diffstat:

 crypto/external/bsd/netpgp/dist/src/libbn/bignum.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (40 lines):

diff -r 2cfc4b4d287e -r 45b0f38dd3ac crypto/external/bsd/netpgp/dist/src/libbn/bignum.c
--- a/crypto/external/bsd/netpgp/dist/src/libbn/bignum.c        Wed Nov 21 23:11:23 2012 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/libbn/bignum.c        Thu Nov 22 00:37:55 2012 +0000
@@ -500,7 +500,7 @@
     }
 
     /* free ram */
-    netpgp_deallocate(a->dp, a->alloc);
+    netpgp_deallocate(a->dp, (size_t)a->alloc);
 
     /* reset members to make debugging easier */
     a->dp    = NULL;
@@ -4789,6 +4789,7 @@
    if ((q & 1) == 0) {
       do {
          qq  = q & 15;
+        /* LINTED previous op ensures range of qq */
          x  += lnz[qq];
          q >>= 4;
       } while (qq == 0);
@@ -5064,6 +5065,7 @@
       mp_clear (&t);
       return res;
     }
+    /* LINTED -- radix' range is checked above, limits d's range */
     *str++ = mp_s_rmap[d];
     ++digs;
   }
@@ -5089,9 +5091,9 @@
        if (mp_radix_size(__UNCONST(a), radix, &len) != MP_OKAY) {
                return NULL;
        }
-       if ((s = netpgp_allocate(1, len)) != NULL) {
+       if ((s = netpgp_allocate(1, (size_t)len)) != NULL) {
                if (mp_toradix_n(__UNCONST(a), s, radix, len) != MP_OKAY) {
-                       netpgp_deallocate(s, len);
+                       netpgp_deallocate(s, (size_t)len);
                        return NULL;
                }
        }



Home | Main Index | Thread Index | Old Index