]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix length check
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 28 Nov 2017 22:20:19 +0000 (22:20 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 28 Nov 2017 22:20:19 +0000 (22:20 +0000)
src/modules/rlm_eap/lib/sim/id.c

index 8cb3b4dd36f1e94c68ab300d416d937998e3cdb9..e4def829957e761c6feea1af1ec8ea41657b2dcb 100644 (file)
@@ -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;
        }