Skip to content

Commit

Permalink
Always initialise code
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Mar 3, 2020
1 parent 0c84dac commit bfcfa7c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/rlm_radius/rlm_radius_udp.c
Expand Up @@ -774,6 +774,8 @@ static decode_fail_t decode(TALLOC_CTX *ctx, VALUE_PAIR **reply, uint8_t *code_o
uint8_t code;
uint8_t original[RADIUS_HEADER_LENGTH];

*code_out = 0; /* Initialise to keep the rest of the code happy */

packet_len = data_len;
if (!fr_radius_ok(data, &packet_len, inst->parent->max_attributes, false, &reason)) {
RWARN("%s - Ignoring malformed packet", h->module_name);
Expand All @@ -793,7 +795,7 @@ static decode_fail_t decode(TALLOC_CTX *ctx, VALUE_PAIR **reply, uint8_t *code_o

if (fr_radius_verify(data, original,
(uint8_t const *) inst->secret, talloc_array_length(inst->secret) - 1) < 0) {
if (request) RPWDEBUG("Ignoring response with invalid signature");
RPWDEBUG("Ignoring response with invalid signature");
return DECODE_FAIL_MA_INVALID;
}

Expand Down

0 comments on commit bfcfa7c

Please sign in to comment.