bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#36279: 26.2.90; (process-attributes nonexistent-pid) segmentation fa


From: Eli Zaretskii
Subject: bug#36279: 26.2.90; (process-attributes nonexistent-pid) segmentation fault
Date: Tue, 18 Jun 2019 20:44:41 +0300

> Date: Wed, 19 Jun 2019 00:23:20 +0800
> From: xuchunyang <mail@xuchunyang.me>
> Cc: 36279@debbugs.gnu.org, Noam Postavsky <npostavs@gmail.com>
> 
> It fixes the issue for me too. (process-attributes 123456) returns nil 
> instead of crashing Emacs.
> 
> > 
> > diff --git a/src/sysdep.c b/src/sysdep.c
> > index 1e35e06b63..518ecebcf6 100644
> > --- a/src/sysdep.c
> > +++ b/src/sysdep.c
> > @@ -3798,7 +3798,7 @@ system_process_attributes (Lisp_Object pid)
> >    CONS_TO_INTEGER (pid, int, proc_id);
> >    mib[3] = proc_id;
> >  
> > -  if (sysctl (mib, 4, &proc, &proclen, NULL, 0) != 0)
> > +  if (sysctl (mib, 4, &proc, &proclen, NULL, 0) != 0 || proclen == 0)
> >      return attrs;
> >  
> >    uid = proc.kp_eproc.e_ucred.cr_uid;
> >

Thanks.  Robert, please push to the emacs-26 branch.

(I understand this problem is quite old, is that right?)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]