mirror of
https://github.com/3proxy/3proxy.git
synced 2026-08-05 17:20:11 +08: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 / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI MacOS / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI Windows / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
C/C++ CI cmake / ubuntu-latest (wolfSSL) (push) Has been cancelled
Some checks failed
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI MacOS / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI Windows / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (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
@ -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…
Reference in New Issue
Block a user