Merge pull request #583 from SashaXser/master

Фиксы от CodeQL
This commit is contained in:
bol-van 2024-10-12 22:00:29 +03:00 committed by GitHub
commit d760093f52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1087,7 +1087,7 @@ static bool read_system_maxfiles(rlim_t *maxfile)
return false;
n=fscanf(F,"%ju",&um);
fclose(F);
if (!n) return false;
if (n != 1) return false;
*maxfile = (rlim_t)um;
return true;
#elif defined(BSD)
@ -1132,7 +1132,7 @@ static bool set_ulimit(void)
// additional 1/2 for unpaired remote legs sending buffers
// 16 for listen_fd, epoll, hostlist, ...
#ifdef SPLICE_PRESENT
fdmax = (params.nosplice ? 2 : (params.tamper && !params.tamper_lim ? 4 : 6)) * params.maxconn;
fdmax = (rlim_t)(params.nosplice ? 2 : (params.tamper && !params.tamper_lim ? 4 : 6)) * (rlim_t)params.maxconn;
#else
fdmax = 2 * params.maxconn;
#endif