From: jbj Date: Mon, 2 Aug 2004 16:56:03 +0000 (+0000) Subject: Splint fiddles. X-Git-Tag: tznext/4.11.0.1.tizen20130304~6404 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=43aa4c17b0c5558515e0e32d6f9e956b54ffd369;p=tools%2Flibrpm-tizen.git Splint fiddles. CVS patchset: 7380 CVS date: 2004/08/02 16:56:03 --- diff --git a/beecrypt/.splintrc b/beecrypt/.splintrc index 8d33e98..f1dbea6 100644 --- a/beecrypt/.splintrc +++ b/beecrypt/.splintrc @@ -24,7 +24,6 @@ -compdestroy -compmempass -evalorder --evalorderuncon -globs -globstate -infloops @@ -32,20 +31,19 @@ -internalglobs -mayaliasunique -modfilesys --modobserveruncon --moduncon +-moduncon # 22 -mustfreefresh -mustfreeonly -namechecks -noeffect --noeffectuncon +-noeffectuncon # 12 -nullderef --nullpass +-nullpass # 14 -nullptrarith --nullret --nullstate +-nullret # 2 +-nullstate # 1 -paramuse --protoparammatch +-protoparammatch # 7 +ptrnegate -retalias -retvalint @@ -65,7 +63,7 @@ -readonlytrans -statictrans -temptrans --unqualifiedtrans +-unqualifiedtrans # 11 -looploopbreak -looploopcontinue @@ -79,7 +77,6 @@ -fcnuse -typeuse - -elseifcomplete -whileempty diff --git a/beecrypt/base64.h b/beecrypt/base64.h index e775b99..b01a979 100644 --- a/beecrypt/base64.h +++ b/beecrypt/base64.h @@ -55,7 +55,7 @@ extern "C" { * \param ns no. bytes of data (0 uses strlen(data)) * \return (malloc'd) base64 string */ -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ char* b64encode(const void* data, size_t ns) /*@*/; @@ -65,7 +65,7 @@ char* b64encode(const void* data, size_t ns) * \param ns no. bytes of binary data * \return (malloc'd) base64 string */ -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ char* b64crc(const unsigned char* data, size_t ns) /*@*/; @@ -82,13 +82,13 @@ int b64decode(const char* s, void** datap, size_t* lenp) /*! */ -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ char* b64enc(const memchunk*) /*@*/; /*! */ -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ memchunk* b64dec(const char*) /*@*/; diff --git a/beecrypt/beecrypt.h b/beecrypt/beecrypt.h index ac644d6..5fec9ad 100644 --- a/beecrypt/beecrypt.h +++ b/beecrypt/beecrypt.h @@ -92,7 +92,7 @@ int entropySourceCount(void) * \return A pointer to an entropy source or null, if the index was out of * range. */ -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ const entropySource* entropySourceGet(int n) /*@*/; @@ -101,7 +101,7 @@ const entropySource* entropySourceGet(int n) * \param name Name of the requested entropy source. * \return A pointer to an entropy source or null, if the name wasn't found. */ -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ const entropySource* entropySourceFind(const char* name) /*@*/; @@ -110,7 +110,7 @@ const entropySource* entropySourceFind(const char* name) * can be specified by setting environment variable BEECRYPT_ENTROPY. * \return A pointer to an entropy source or null, in case an error occured. */ -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ const entropySource* entropySourceDefault(void) /*@*/; @@ -227,13 +227,13 @@ extern "C" { BEECRYPTAPI int randomGeneratorCount(void) /*@*/; -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ const randomGenerator* randomGeneratorGet(int index) /*@*/; -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ const randomGenerator* randomGeneratorFind(const char* name) /*@*/; -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ const randomGenerator* randomGeneratorDefault(void) /*@*/; @@ -253,6 +253,7 @@ struct _randomGeneratorContext #endif { const randomGenerator* rng; +/*@relnull@*/ randomGeneratorParam* param; #ifdef __cplusplus @@ -359,13 +360,13 @@ extern "C" { BEECRYPTAPI int hashFunctionCount(void) /*@*/; -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ const hashFunction* hashFunctionGet(int index) /*@*/; -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ const hashFunction* hashFunctionFind(const char* name) /*@*/; -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ const hashFunction* hashFunctionDefault(void) /*@*/; @@ -384,6 +385,7 @@ struct _hashFunctionContext #endif { const hashFunction* algo; +/*@relnull@*/ hashFunctionParam* param; #ifdef __cplusplus @@ -515,13 +517,13 @@ extern "C" { BEECRYPTAPI int keyedHashFunctionCount(void) /*@*/; -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ const keyedHashFunction* keyedHashFunctionGet(int index) /*@*/; -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ const keyedHashFunction* keyedHashFunctionFind(const char* name) /*@*/; -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ const keyedHashFunction* keyedHashFunctionDefault(void) /*@*/; @@ -540,6 +542,7 @@ struct _keyedHashFunctionContext #endif { const keyedHashFunction* algo; +/*@relnull@*/ keyedHashFunctionParam* param; #ifdef __cplusplus @@ -765,7 +768,7 @@ int blockCipherCount(void) * \return A pointer to a blockcipher or null, if the index was out of * range. */ -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ const blockCipher* blockCipherGet(int index) /*@*/; @@ -774,7 +777,7 @@ const blockCipher* blockCipherGet(int index) * \param name Name of the requested blockcipher. * \return A pointer to a blockcipher or null, if the name wasn't found. */ -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ const blockCipher* blockCipherFind(const char* name) /*@*/; @@ -783,7 +786,7 @@ const blockCipher* blockCipherFind(const char* name) * can be specified by setting environment variable BEECRYPT_CIPHER. * \return A pointer to a blockcipher or null, in case an error occured. */ -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ const blockCipher* blockCipherDefault(void) /*@*/; @@ -808,6 +811,7 @@ struct _blockCipherContext /*!\var param * \brief Pointer to the parameters used by algo. */ +/*@relnull@*/ blockCipherParam* param; /*!\var op */ diff --git a/beecrypt/blockpad.h b/beecrypt/blockpad.h index 99a749a..75b2595 100644 --- a/beecrypt/blockpad.h +++ b/beecrypt/blockpad.h @@ -32,17 +32,17 @@ extern "C" { #endif -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ memchunk* pkcs5Pad (size_t blockbytes, memchunk* tmp) /*@modifies tmp @*/; -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ memchunk* pkcs5Unpad(size_t blockbytes, memchunk* tmp) /*@modifies tmp @*/; -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ memchunk* pkcs5PadCopy (size_t blockbytes, const memchunk* src) /*@*/; -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ memchunk* pkcs5UnpadCopy(size_t blockbytes, const memchunk* src) /*@*/; diff --git a/beecrypt/dhaes.h b/beecrypt/dhaes.h index b8a9e47..e67c718 100644 --- a/beecrypt/dhaes.h +++ b/beecrypt/dhaes.h @@ -82,7 +82,7 @@ int dhaes_pContextFree (dhaes_pContext* ctxt) BEECRYPTAPI memchunk* dhaes_pContextEncrypt(dhaes_pContext* ctxt, mpnumber* ephemeralPublicKey, mpnumber* mac, const memchunk* cleartext, randomGeneratorContext* rng) /*@modifies ctxt, ephemeralPublicKey, mac @*/; -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ memchunk* dhaes_pContextDecrypt(dhaes_pContext* ctxt, const mpnumber* ephemeralPublicKey, const mpnumber* mac, const memchunk* ciphertext) /*@modifies ctxt @*/; diff --git a/beecrypt/memchunk.h b/beecrypt/memchunk.h index ba8da6d..b3f3462 100644 --- a/beecrypt/memchunk.h +++ b/beecrypt/memchunk.h @@ -28,6 +28,7 @@ typedef struct { size_t size; +/*@relnull@*/ byte* data; } memchunk; @@ -35,7 +36,7 @@ typedef struct extern "C" { #endif -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ memchunk* memchunkAlloc(size_t size) /*@*/; BEECRYPTAPI @@ -44,10 +45,10 @@ void memchunkWipe(memchunk* m) BEECRYPTAPI void memchunkFree(memchunk* m) /*@modifies m @*/; -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ memchunk* memchunkResize(memchunk* m, size_t size) /*@modifies m @*/; -BEECRYPTAPI +BEECRYPTAPI /*@null@*/ memchunk* memchunkClone(const memchunk* m) /*@*/; diff --git a/beecrypt/mpbarrett.h b/beecrypt/mpbarrett.h index 5b7b4bc..f3cd2c9 100644 --- a/beecrypt/mpbarrett.h +++ b/beecrypt/mpbarrett.h @@ -40,7 +40,9 @@ struct _mpbarrett #endif { size_t size; +/*@relnull@*/ mpw* modl; /* (size) words */ +/*@relnull@*/ mpw* mu; /* (size+1) words */ #ifdef __cplusplus diff --git a/beecrypt/mpnumber.h b/beecrypt/mpnumber.h index 4fc3e3b..8b49f7c 100644 --- a/beecrypt/mpnumber.h +++ b/beecrypt/mpnumber.h @@ -39,6 +39,7 @@ struct _mpnumber #endif { size_t size; +/*@relnull@*/ mpw* data; #ifdef __cplusplus diff --git a/beecrypt/mpprime.c b/beecrypt/mpprime.c index 58e5e85..b75a6ab 100644 --- a/beecrypt/mpprime.c +++ b/beecrypt/mpprime.c @@ -709,7 +709,7 @@ int mpptrials(size_t bits) /* * needs workspace of (size*2) words */ -static void mpprndbits(mpbarrett* p, size_t bits, size_t lsbset, const mpnumber* min, const mpnumber* max, randomGeneratorContext* rc, mpw* wksp) +static void mpprndbits(mpbarrett* p, size_t bits, size_t lsbset, /*@null@*/ const mpnumber* min, /*@null@*/ const mpnumber* max, randomGeneratorContext* rc, mpw* wksp) /*@modifies p, wksp @*/ { register size_t size = p->size; diff --git a/beecrypt/mpprime.h b/beecrypt/mpprime.h index 3e3590a..e0cabc2 100644 --- a/beecrypt/mpprime.h +++ b/beecrypt/mpprime.h @@ -44,10 +44,10 @@ int mppmilrab_w (const mpbarrett* p, randomGeneratorContext* rc, int t, mpw* /*@modifies wksp @*/; BEECRYPTAPI -int mpprnd_w (mpbarrett* p, randomGeneratorContext* rc, size_t bits, int t, const mpnumber* f, mpw* wksp) +int mpprnd_w (mpbarrett* p, randomGeneratorContext* rc, size_t bits, int t, /*@null@*/ const mpnumber* f, mpw* wksp) /*@modifies p, wksp @*/; BEECRYPTAPI -int mpprndr_w (mpbarrett* p, randomGeneratorContext* rc, size_t bits, int t, const mpnumber* min, const mpnumber* max, const mpnumber* f, mpw* wksp) +int mpprndr_w (mpbarrett* p, randomGeneratorContext* rc, size_t bits, int t, /*@null@*/ const mpnumber* min, /*@null@*/ const mpnumber* max, const mpnumber* f, mpw* wksp) /*@modifies p, wksp @*/; BEECRYPTAPI void mpprndsafe_w (mpbarrett* p, randomGeneratorContext* rc, size_t bits, int t, mpw* wksp) @@ -56,7 +56,7 @@ BEECRYPTAPI void mpprndcon_w (mpbarrett*, randomGeneratorContext*, size_t, int, const mpnumber*, const mpnumber*, const mpnumber*, mpnumber*, mpw*) /*@*/; BEECRYPTAPI -void mpprndconone_w(mpbarrett* p, randomGeneratorContext* rc, size_t bits, int t, const mpbarrett* q, const mpnumber* f, mpnumber* r, int cofactor, mpw* wksp) +void mpprndconone_w(mpbarrett* p, randomGeneratorContext* rc, size_t bits, int t, const mpbarrett* q, /*@null@*/ const mpnumber* f, mpnumber* r, int cofactor, mpw* wksp) /*@modifies p, r, wksp @*/; #ifdef __cplusplus