Hi,

we found that ksh segfaults when executing 'kill %'
Reproducer:
ksh -c 'kill %'

in sh/jobs.c:

job_wallk():
  if(*jobid == '%')
    pw = job_bystring(jobid);
  ...
  if((*fun)(pw,arg))

calls job_kill(pw,sig) with pw = NULL

first line in job_kill is

Shell_t *shp = pw->p_shp;

but because pw is NULL, it crashes.

There is check for pw 30 lines later:

if(pw==0)
  goto error;

so it should be reordered.

Michal


_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to