mirror of
https://github.com/3proxy/3proxy.git
synced 2026-08-04 14:46:18 +00:00
Fix: buffer overflow in radsend (log radius or combination of auth radius with fakeresolve must be enabled, RADIUS feature is experimental)
Some checks failed
C/C++ CI Linux / ubuntu-24.04-arm (push) Waiting to run
C/C++ CI Linux / ubuntu-latest (push) Waiting to run
C/C++ CI MacOS / macos-15 (push) Has been cancelled
C/C++ CI Windows / windows-2022 (push) Has been cancelled
C/C++ CI cmake / macos-15 (push) Has been cancelled
C/C++ CI cmake / ubuntu-24.04-arm (push) Has been cancelled
C/C++ CI cmake / ubuntu-latest (push) Has been cancelled
C/C++ CI cmake / windows-2022 (push) Has been cancelled
C/C++ CI cmake / ubuntu-latest (wolfSSL) (push) Has been cancelled
Some checks failed
C/C++ CI Linux / ubuntu-24.04-arm (push) Waiting to run
C/C++ CI Linux / ubuntu-latest (push) Waiting to run
C/C++ CI MacOS / macos-15 (push) Has been cancelled
C/C++ CI Windows / windows-2022 (push) Has been cancelled
C/C++ CI cmake / macos-15 (push) Has been cancelled
C/C++ CI cmake / ubuntu-24.04-arm (push) Has been cancelled
C/C++ CI cmake / ubuntu-latest (push) Has been cancelled
C/C++ CI cmake / windows-2022 (push) Has been cancelled
C/C++ CI cmake / ubuntu-latest (wolfSSL) (push) Has been cancelled
This commit is contained in:
parent
5f542a505a
commit
e4a5a7252c
2 changed files with 7 additions and 0 deletions
|
|
@ -391,6 +391,7 @@ int radsend(struct clientparam * param, int auth, int stop){
|
|||
if(conf.stringtable){
|
||||
*ptr++ = PW_NAS_IDENTIFIER;
|
||||
len = strlen((char *)conf.stringtable[SERVICES+param->service]);
|
||||
if(len > 253) len = 253;
|
||||
*ptr++ = (2 + len);
|
||||
memcpy(ptr, conf.stringtable[SERVICES+param->service], len);
|
||||
ptr += len;
|
||||
|
|
@ -416,6 +417,7 @@ int radsend(struct clientparam * param, int auth, int stop){
|
|||
if(param->hostname){
|
||||
*ptr++ = PW_CALLED_STATION_ID;
|
||||
len = strlen((char *)param->hostname);
|
||||
if(len > 253) len = 253;
|
||||
*ptr++ = (2 + len);
|
||||
memcpy(ptr, param->hostname, len);
|
||||
ptr += len;
|
||||
|
|
|
|||
|
|
@ -507,6 +507,11 @@ int parsehostname(char *hostname, struct clientparam *param, uint16_t port){
|
|||
*SAPORT(¶m->req) = htons(port);
|
||||
return 0;
|
||||
}
|
||||
if(strlen(hostname + (se!=0)) > 253){
|
||||
if(se) *se = ']';
|
||||
if(sp) *sp = ':';
|
||||
return 1;
|
||||
}
|
||||
if(hostname != (char *)param->hostname){
|
||||
if(param->hostname) free(param->hostname);
|
||||
param->hostname = (unsigned char *)strdup(hostname + (se!=0));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue