From: Alan T. DeKok Date: Wed, 9 Jan 2019 15:33:43 +0000 (-0500) Subject: remove redundant checks X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe9fa209bf9da652a6bad6296f7ee8a80ba35902;p=thirdparty%2Ffreeradius-server.git remove redundant checks --- diff --git a/src/modules/rlm_passwd/rlm_passwd.c b/src/modules/rlm_passwd/rlm_passwd.c index 236ae74cea3..dfa3e92518f 100644 --- a/src/modules/rlm_passwd/rlm_passwd.c +++ b/src/modules/rlm_passwd/rlm_passwd.c @@ -97,7 +97,7 @@ static int string_to_entry(char const* string, int num_fields, char delimiter, if(!len) return 0; if (string[len-1] == '\r') len--; if(!len) return 0; - if (!len || !passwd || + if (!passwd || bufferlen < (len + num_fields * sizeof (char*) + num_fields * sizeof (char) + sizeof (struct mypasswd) + 1) ) return 0; passwd->next = NULL; data_beg=(char *)passwd + sizeof(struct mypasswd);