]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
use memchr on binary fields
authorAlan T. DeKok <aland@freeradius.org>
Fri, 27 May 2016 00:47:39 +0000 (20:47 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 27 May 2016 00:47:39 +0000 (20:47 -0400)
src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c

index ec54d9f422e830d20e3a3db1b2a1bc3a99ace311..223456c0b97d3debb9bcfcdd46e3a41146c7d504 100644 (file)
@@ -650,7 +650,7 @@ packet_ready:
                 */
                if (inst->with_ntdomain_hack &&
                    ((challenge = fr_pair_find_by_num(request->packet->vps, PW_USER_NAME, 0, TAG_ANY)) != NULL) &&
-                   ((username = strchr(challenge->vp_strvalue, '\\')) != NULL)) {
+                   ((username = memchr(challenge->vp_octets, '\\', challenge->vp_length)) != NULL)) {
                        /*
                         *      Wipe out the NT domain.
                         *