mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-06-24 14:23:47 +08:00
PPP: remove casts from unsigned (strlen return value) to signed when checking auth
In theory, if provided username or password is over 0x80000000 byte long (err...), casts to signed integer of strlen() return values is going to return negative values breaking lengths checks. Fix it by only using unsigned integer or size_t (guaranteed to be unsigned) comparisons.
This commit is contained in:
@@ -559,7 +559,7 @@ void start_networks(ppp_pcb *pcb); /* start all the network control protos */
|
||||
void continue_networks(ppp_pcb *pcb); /* start network [ip, etc] control protos */
|
||||
#if PPP_AUTH_SUPPORT
|
||||
#if PPP_SERVER
|
||||
int auth_check_passwd(ppp_pcb *pcb, char *auser, int userlen, char *apasswd, int passwdlen, const char **msg, int *msglen);
|
||||
int auth_check_passwd(ppp_pcb *pcb, char *auser, unsigned int userlen, char *apasswd, unsigned int passwdlen, const char **msg, int *msglen);
|
||||
/* check the user name and passwd against configuration */
|
||||
void auth_peer_fail(ppp_pcb *pcb, int protocol);
|
||||
/* peer failed to authenticate itself */
|
||||
|
||||
Reference in New Issue
Block a user