]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/plugins/radius/radius.c
Additional fixes for broken build
[ppp.git] / pppd / plugins / radius / radius.c
index b4bc896bce4941f91056e11b9b1c39ecc7a21d7c..c73ca0b53ef82b07932fa304d667ff22e0d7db7a 100644 (file)
@@ -44,9 +44,9 @@ static char const RCSID[] =
 #include <pppd/chap_ms.h>
 #ifdef PPP_WITH_MPPE
 #include <pppd/mppe.h>
-#include <pppd/crypto.h>
 #endif
 #endif
+#include <pppd/crypto.h>
 #include <pppd/fsm.h>
 #include <pppd/ipcp.h>
 
@@ -649,7 +649,8 @@ radius_setparams(VALUE_PAIR *vp, char *msg, REQUEST_INFO *req_info,
                 break;
            case PW_CLASS:
                /* Save Class attribute to pass it in accounting request */
-               if (vp->lvalue <= MAXCLASSLEN) {
+               // if (vp->lvalue <= MAXCLASSLEN) { // <- Attribute could be this big, but vp->strvalue is limited to AUTH_STRING_LEN characters
+               if (vp->lvalue <= AUTH_STRING_LEN) {
                    rstate.class_len=vp->lvalue;
                    memcpy(rstate.class, vp->strvalue, rstate.class_len);
                } /* else too big for our buffer - ignore it */