shithub: mc

Download patch

ref: 2c814b34375827b994cd448160304c18ddbbeb5c
parent: 6132de5dda8f522a226ecc554394caee6ac80dbf
author: Ori Bernstein <[email protected]>
date: Sat Aug 23 17:19:58 EDT 2014

Use the correct length of the new value for sysctl

   We were using the pointer as the size of the new value. This
   is very wrong.

--- a/libstd/sys-freebsd.myr
+++ b/libstd/sys-freebsd.myr
@@ -767,7 +767,7 @@
 	oldp = o castto(byte#)
 	oldsz = a(o.len)
 	newp = new castto(byte#)
-	newsz = a(new)
+	newsz = a(new.len)
 
 	/* all args already passed through a() or ar  ptrs */
 	ret = syscall(Sys__sysctl, mibp, mibsz, oldp, oldsz, newp, newsz) castto(int)