From: Geoff Rehmet <g89r4222@braae.ru.ac.za>
authorNate Willams <nate@FreeBSD.org>
Wed, 17 Nov 1993 22:06:18 +0000 (22:06 +0000)
committerNate Willams <nate@FreeBSD.org>
Wed, 17 Nov 1993 22:06:18 +0000 (22:06 +0000)
To: FreeBSD-bugfiler@freefall.cdrom.com

Description:
After rebuilding the world with shlibs, ps and w fail.
ps fails, complaining that it can't get a kerninfo estimate.
w just fails to get anything in the WHAT field.

It turns out that the getkerninfo call in ps causes a NULL
pointer dereference.
(Again the new linker caused this to be picked up.)
Repeat-By:
executing ps or w.

sys/kern/kern_kinfo.c

index 6c98b4c..605787e 100644 (file)
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *     from: @(#)kern_kinfo.c  7.17 (Berkeley) 6/26/91
  * SUCH DAMAGE.
  *
  *     from: @(#)kern_kinfo.c  7.17 (Berkeley) 6/26/91
- *     $Id: kern_kinfo.c,v 1.3 1993/10/16 15:24:18 rgrimes Exp $
+ *     $Id: kern_kinfo.c,v 1.4 1993/11/07 21:44:42 wollman Exp $
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -67,9 +67,10 @@ getkerninfo(p, uap, retval)
        int bufsize;            /* max size of users buffer */
        int needed, locked, (*server)(), error = 0;
 
        int bufsize;            /* max size of users buffer */
        int needed, locked, (*server)(), error = 0;
 
-       if (error = copyin((caddr_t)uap->size, (caddr_t)&bufsize,
-           sizeof (bufsize)))
-               goto done;
+       if(uap->size != (int *)NULL)
+               if (error = copyin((caddr_t)uap->size, (caddr_t)&bufsize,
+               sizeof (bufsize)))
+                       goto done;
 
        switch (ki_type(uap->op)) {
 
 
        switch (ki_type(uap->op)) {