From: Arran Cudbard-Bell Date: Tue, 28 Nov 2017 22:20:19 +0000 (+0000) Subject: Fix length check X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c908f8f05642e54eec4ddd8de71d8bfdde4f4171;p=thirdparty%2Ffreeradius-server.git Fix length check --- diff --git a/src/modules/rlm_eap/lib/sim/id.c b/src/modules/rlm_eap/lib/sim/id.c index 8cb3b4dd36f..e4def829957 100644 --- a/src/modules/rlm_eap/lib/sim/id.c +++ b/src/modules/rlm_eap/lib/sim/id.c @@ -513,8 +513,9 @@ int fr_sim_id_3gpp_pseudonym_decrypt(char out[SIM_IMSI_MAX_LEN + 1], * This should never happen, and probably means that * some sort of memory corruption has occured. */ - if (unlikely(decr_len > SIM_IMSI_MAX_LEN)) { - fr_strerror_printf("Decrypted data len invalid"); + if (unlikely(decr_len > (SIM_IMSI_MAX_LEN + 1))) { + fr_strerror_printf("Decrypted data len invalid. Expected %i bytes, got %zu bytes", + (SIM_IMSI_MAX_LEN + 1), decr_len); goto error; }