Skip to content

Commit

Permalink
Remove warnings from clang --analyze
Browse files Browse the repository at this point in the history
  • Loading branch information
guanzhi committed Jun 18, 2024
1 parent 5676042 commit 572ab07
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/tls_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,6 @@ int tls_extensions_print(FILE *fp, const uint8_t *exts, size_t extslen, int form
int tls_hello_request_print(FILE *fp, const uint8_t *data, size_t datalen, int format, int indent)
{
format_print(fp, format, indent, "HelloRequest\n");
indent += 4;
if (data || datalen > 0) {
error_print();
return -1;
Expand Down
2 changes: 1 addition & 1 deletion src/x509_cer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ int x509_cert_sign_to_der(
uint8_t **out, size_t *outlen)
{
size_t len = 0;
uint8_t *tbs;
uint8_t *tbs = NULL;
int sig_alg = OID_sm2sign_with_sm3;
uint8_t sig[SM2_MAX_SIGNATURE_SIZE];
size_t siglen = SM2_signature_typical_size;
Expand Down
2 changes: 1 addition & 1 deletion src/x509_crl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,7 @@ int x509_crl_sign_to_der(
uint8_t **out, size_t *outlen)
{
size_t len = 0;
uint8_t *tbs;
uint8_t *tbs = NULL;
uint8_t sig[SM2_MAX_SIGNATURE_SIZE];
size_t siglen = SM2_signature_typical_size;

Expand Down
2 changes: 1 addition & 1 deletion src/x509_req.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ int x509_req_sign_to_der(
uint8_t **out, size_t *outlen)
{
size_t len = 0;
uint8_t *tbs;
uint8_t *tbs = NULL;
int sig_alg = OID_sm2sign_with_sm3;
uint8_t sig[SM2_MAX_SIGNATURE_SIZE];
size_t siglen = SM2_signature_typical_size;
Expand Down
11 changes: 4 additions & 7 deletions src/zuc.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ void zuc_encrypt(ZUC_STATE *state, const uint8_t *in, size_t inlen, uint8_t *out

// table lookup together makes 10% faster
T0 = S0[(U >> 24) ];
T0 = S0[(U >> 24) ];
T2 = S0[(U >> 8) & 0xFF];
T4 = S0[(V >> 24) ];
T6 = S0[(V >> 8) & 0xFF];
Expand Down Expand Up @@ -435,12 +434,12 @@ void zuc_mac_update(ZUC_MAC_CTX *ctx, const uint8_t *data, size_t len)

void zuc_mac_finish(ZUC_MAC_CTX *ctx, const uint8_t *data, size_t nbits, uint8_t mac[4])
{
ZUC_UINT32 T = ctx->T;
ZUC_UINT32 K0 = ctx->K0;
ZUC_UINT32 T;
ZUC_UINT32 K0;
ZUC_UINT32 K1, M;
ZUC_UINT31 *LFSR = ctx->LFSR;
ZUC_UINT32 R1 = ctx->R1;
ZUC_UINT32 R2 = ctx->R2;
ZUC_UINT32 R1;
ZUC_UINT32 R2;
ZUC_UINT32 X0, X1, X2, X3;
ZUC_UINT32 W1, W2, U, V;
size_t i;
Expand All @@ -456,11 +455,9 @@ void zuc_mac_finish(ZUC_MAC_CTX *ctx, const uint8_t *data, size_t nbits, uint8_t

T = ctx->T;
K0 = ctx->K0;
LFSR = ctx->LFSR;
R1 = ctx->R1;
R2 = ctx->R2;


if (nbits)
ctx->buf[ctx->buflen] = *data;

Expand Down
1 change: 0 additions & 1 deletion src/zuc_modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ int zuc_encrypt_update(ZUC_CTX *ctx, const uint8_t *in, size_t inlen, uint8_t *o
zuc_encrypt(&ctx->zuc_state, in, len, out);
in += len;
inlen -= len;
out += len;
*outlen += len;
}
if (inlen) {
Expand Down

0 comments on commit 572ab07

Please sign in to comment.