Fix for 64 bit platforms. sysctl's length args are pointers to
size_t, not int. This could be fatal where size_t is long. Reviewed by: bp
This commit is contained in:
parent
bc3b454720
commit
823c05fbc4
@ -274,7 +274,8 @@ ncp_li_check(struct ncp_conn_loginfo *li) {
|
||||
|
||||
int
|
||||
ncp_conn_cnt(void) {
|
||||
int error, cnt = 0, len = sizeof(cnt);
|
||||
int error, cnt = 0;
|
||||
size_t len = sizeof(cnt);
|
||||
|
||||
error = sysctlbyname("net.ncp.conn_cnt", &cnt, &len, NULL, 0);
|
||||
if (error) cnt = 0;
|
||||
@ -382,7 +383,8 @@ ncp_li_arg(struct ncp_conn_loginfo *li, int opt, char *arg) {
|
||||
|
||||
void *
|
||||
ncp_conn_list(void) {
|
||||
int error, cnt = 0, len;
|
||||
int error, cnt = 0;
|
||||
size_t len;
|
||||
void *p;
|
||||
|
||||
cnt = ncp_conn_cnt();
|
||||
|
@ -243,7 +243,8 @@ NWRequest(NWCONN_HANDLE cH, nuint16 fn,
|
||||
int
|
||||
ncp_initlib(void){
|
||||
int error;
|
||||
int kv, kvlen = sizeof(kv);
|
||||
int kv;
|
||||
size_t kvlen = sizeof(kv);
|
||||
static int ncp_initialized;
|
||||
|
||||
if (ncp_initialized)
|
||||
|
Loading…
x
Reference in New Issue
Block a user