Skip to content

Commit 0013b87

Browse files
authored
Merge pull request #1 from Pairarma/develop
Fix unused variable warnings
2 parents 03e0b2d + f1d94ad commit 0013b87

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

forwarder/pit.c

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ static void ndn_pit_timeout(void *selfptr, size_t param_len, void *param){
3434
ndn_on_timeout_func on_timeout = NULL;
3535
void* userdata = NULL;
3636

37+
NDN_LOG_DEBUG("[PIT] timeout with pointer to parameter: %p and size: %d\n", (void*) param, param_len);
38+
3739
for(i = 0; i < self->capacity; i ++){
3840
if(self->slots[i].nametree_id == NDN_INVALID_ID){
3941
continue;

security/default-backend/ndn-lite-default-ecc-impl.c

+4
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ ndn_lite_default_ecdsa_verify(const uint8_t* input_value, uint32_t input_size,
147147
return NDN_SEC_WRONG_KEY_SIZE;
148148
if (ecdsa_type != NDN_ECDSA_CURVE_SECP256R1)
149149
return NDN_SEC_UNSUPPORT_CRYPTO_ALGO;
150+
if (input_size == 0)
151+
return NDN_SEC_WRONG_INPUT_SIZE;
150152

151153
uint8_t raw_sig_temp_buf[NDN_SEC_ECC_SECP256R1_PUBLIC_KEY_SIZE];
152154
uint32_t decoded_raw_signature_size;
@@ -176,6 +178,8 @@ ndn_lite_default_ecdsa_sign(const uint8_t* input_value, uint32_t input_size,
176178
return NDN_SEC_WRONG_KEY_SIZE;
177179
if (ecdsa_type != NDN_ECDSA_CURVE_SECP256R1)
178180
return NDN_SEC_UNSUPPORT_CRYPTO_ALGO;
181+
if (input_size == 0)
182+
return NDN_SEC_WRONG_INPUT_SIZE;
179183

180184
uint32_t signature_size = NDN_SEC_ECC_SECP256R1_PUBLIC_KEY_SIZE;
181185
int ecc_sign_result = 0;

security/default-backend/ndn-lite-default-rng-impl.c

+3
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88
* See AUTHORS.md for complete list of NDN-LITE authors and contributors.
99
*/
1010

11+
#include <stddef.h>
1112
#include "ndn-lite-default-rng-impl.h"
1213
#include "../ndn-lite-rng.h"
1314
#include "../../ndn-error-code.h"
1415

1516
/* always fails and return 0 */
1617
static int ndn_lite_default_rng(uint8_t *dest, unsigned size)
1718
{
19+
if (dest == NULL || size == 0)
20+
return 0;
1821
return 0;
1922
}
2023

0 commit comments

Comments
 (0)