]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add check for min-max of AT_RES
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 3 Dec 2017 13:49:47 +0000 (13:49 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 3 Dec 2017 13:49:47 +0000 (13:49 +0000)
src/modules/rlm_eap/lib/sim/decode.c

index 040d74183b4c3d001dccf90d8f4e85ba04fc6878..4f90076fd1a46b8887c365b2689ff35e0c5debb6 100644 (file)
@@ -587,6 +587,9 @@ static ssize_t sim_decode_pair_value(TALLOC_CTX *ctx, vp_cursor_t *cursor, fr_di
                if (res_len > (attr_len - 2)) {
                        fr_strerror_printf("%s: RES Length field value (%hu) > attribute value length (%zu)",
                                           __FUNCTION__, res_len, (attr_len - 2));
+               if ((res_len < 4) || (res_len > 16)) {
+                       fr_strerror_printf("%s: RES Length field value must be between 32-128 bits, got %u bits",
+                                          __FUNCTION__, (res_len * 8));
                        return -1;
                }