: use unsigned long for nf_userspace_message args
PATCH 1/1 : use unsigned long for nf_userspace_message args
nf_userspace_message args may hold pointers, use unsigned long so they also fit on 64 bit.
fakesockopt.c +4 -4
@@ -234,8 +234,8 @@ msg.args[0 ] =PF_INET ;/*msg.args[1] = level;*/ msg.args[1 ] = optname; - msg.args[2 ] = (int )optval; - msg.args[3 ] = (int )*optlen; + msg.args[2 ] = (unsigned long )optval; + msg.args[3 ] = (unsigned long )*optlen; ret =fake_syscall (&msg); *optlen = msg.args[3 ];return ret;
@@ -249,8 +249,8 @@ msg.args[0 ] =PF_INET ;/*msg.args[1] = level;*/ msg.args[1 ] = optname; - msg.args[2 ] = (int )optval; - msg.args[3 ] = (int )optlen; + msg.args[2 ] = (unsigned long )optval; + msg.args[3 ] = (unsigned long )optlen;return fake_syscall (&msg); }
nfsockopt.h +1 -1
@@ -45,7 +45,7 @@int len;/* syscall/kernelop arguments */ -int args[MAX_MESSAGE_ARGS ]; +unsigned long args[MAX_MESSAGE_ARGS ];/* return val of the syscall/kernelop */ int retval;
message.c +7 -7
@@ -282,7 +282,7 @@ msg.args[3]); msg.retval =nf_getsockopt (NULL , msg.args[0 ], msg.args[1 ], (char *)msg.args[2 ], - &msg.args[3 ]); + (int *)&msg.args[3 ]);if (strace) nfsim_log(LOG_USERSPACE, " getsockopt -> %s (len %i)",
@@ -358,9 +358,9 @@ msg->type =UM_KERNELOP ; msg->opcode =KOP_COPY_TO_USER ; msg->len = n; - msg->args[0 ] = (int )to; - msg->args[1 ] = (int )from; - msg->args[2 ] = (int )n; + msg->args[0 ] = (unsigned long )to; + msg->args[1 ] = (unsigned long )from; + msg->args[2 ] = (unsigned long )n;/* Keep valgrind happy.*/ msg->args[3 ] =0 ;
@@ -393,9 +393,9 @@ msg.type =UM_KERNELOP ; msg.opcode =KOP_COPY_FROM_USER ; msg.len =0 ; - msg.args[0 ] = (int )to; - msg.args[1 ] = (int )from; - msg.args[2 ] = (int )n; + msg.args[0 ] = (unsigned long )to; + msg.args[1 ] = (unsigned long )from; + msg.args[2 ] = (unsigned long )n;/* Keep valgrind happy.*/ msg.args[3 ] =0 ;
core.c +1 -1
@@ -431,7 +431,7 @@ oldpath =getenv ("LD_LIBRARY_PATH" ); path =talloc_asprintf (NULL ,"%s%s%.*s" , oldpath ?:"" , oldpath ?":" :"" , - p - argv[0 ], argv[0 ]); + (int )(p - argv[0 ]), argv[0 ]);setenv ("LD_LIBRARY_PATH" , path,1 );talloc_free (path); }