Skip to content
Permalink
Browse files

use known array size instead of anything else

  • Loading branch information
alandekok committed Aug 28, 2019
1 parent 4dc306e commit dd8aa2ad71bac6dd4b876a65d633102b40aae900
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/lib/server/password.c
@@ -454,6 +454,7 @@ static const size_t fr_password_length[] = {
[FR_SSHA3_384_PASSWORD - 5000 ] = 48,
[FR_SSHA3_512_PASSWORD - 5000 ] = 64,
};
#define MAX_KNOWN_PASSWORD (sizeof(fr_password_length) / sizeof(fr_password_length[0]))


/** Normalise passwords.
@@ -487,7 +488,7 @@ VALUE_PAIR *password_normalise(REQUEST *request, bool normalise)
*/
if (vp->da->parent != root) continue;

if ((vp->da->attr < 5000) || (vp->da->attr > 5099)) continue;
if ((vp->da->attr < 5000) || (vp->da->attr >= (5000 + MAX_KNOWN_PASSWORD))) continue;

/*
* Remove the header, and convert it to something sane.

0 comments on commit dd8aa2a

Please sign in to comment.
You can’t perform that action at this time.