* system.c (sys_sysctl): Cast pointer to long, not size_t,
when we intend to use it as an address. Set oldlen to 0 prior
to reading into it - we want to have deterministic result
if read fails.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
tprints(", ...");
tprintf("}, %d, ", info.nlen);
} else {
- size_t oldlen;
- if (umove(tcp, (size_t)info.oldlenp, &oldlen) >= 0
+ size_t oldlen = 0;
+ if (umove(tcp, (long)info.oldlenp, &oldlen) >= 0
&& info.nlen >= 2
&& ((name[0] == CTL_KERN
&& (name[1] == KERN_OSRELEASE
info.oldval, (unsigned long)oldlen,
info.newval, (unsigned long)info.newlen);
}
- tprints("}");
}
free(name);