killall _process_ crashes with a segmentation fault when some process contains a command line of 128 bytes or more. This is due to erroneous coding at line 209: if(!realloc(&command_buf, cmd_size)) 'realloc' does *not* take a pointer to the pointer to the memory to be reallocated; it takes the memory pointer itself and returns a new pointer. The line should read: if(!(command_buf = realloc(command_buf, cmd_size))) (if one wants to keep it as one line.) On my system, the process that caused the problem was a CUPS print job. The attached patch contains this change.
Created attachment 17305 [details, diff] Proposed patch for psmisc killall
Oops, forgot to name the file (although it should be obvious from the patch or inspecting the source): killall.c.
I could not recreate it, but it does look fishy. Fixed in -r4, thanks.