mirror of
https://github.com/sheumann/hush.git
synced 2025-02-27 13:29:36 +00:00
Really fix the killall segfault this time.
-Erik
This commit is contained in:
parent
632bb57135
commit
b9167cb67f
@ -21,6 +21,7 @@
|
|||||||
* Added tr from John Lombardo <john@deltanet.com>
|
* Added tr from John Lombardo <john@deltanet.com>
|
||||||
* Added echo and test (from me).
|
* Added echo and test (from me).
|
||||||
* Added usleep contributed by Nicolas Pitre <nico@cam.org>
|
* Added usleep contributed by Nicolas Pitre <nico@cam.org>
|
||||||
|
* BusyBox's bss size has been majorly reduced (was 384668, is now 28740).
|
||||||
* Several fixes from Pavel Roskin <pavel_roskin@geocities.com>:
|
* Several fixes from Pavel Roskin <pavel_roskin@geocities.com>:
|
||||||
- When `tail' fails to open a file it now exits.
|
- When `tail' fails to open a file it now exits.
|
||||||
- When `syslogd' is given the `-n' option it should still use
|
- When `syslogd' is given the `-n' option it should still use
|
||||||
@ -60,7 +61,10 @@
|
|||||||
the common error handling saves a few bytes. Thanks to
|
the common error handling saves a few bytes. Thanks to
|
||||||
Bob Tinsley <bob@earthrise.demon.co.uk> for the patch.
|
Bob Tinsley <bob@earthrise.demon.co.uk> for the patch.
|
||||||
* Fix "+" parsing bug in date, from "Merle F. McClelland" <mfm@cts.com>.
|
* Fix "+" parsing bug in date, from "Merle F. McClelland" <mfm@cts.com>.
|
||||||
* BusyBox's bss size has been majorly reduced (was 384668, is now 28740).
|
* Fix symlink following bug in chmod -R and friends.
|
||||||
|
* Now allows SYSV style 'chown foo:bar' in addition to 'chown foo.bar'
|
||||||
|
* Fixed a bug in the busybox globbing routine such that 'find /dir -name [i]'
|
||||||
|
no longer segfaults.
|
||||||
|
|
||||||
|
|
||||||
-Erik Andersen
|
-Erik Andersen
|
||||||
|
@ -1315,7 +1315,8 @@ extern pid_t* findPidByName( char* pidName)
|
|||||||
if (isspace(*(p)))
|
if (isspace(*(p)))
|
||||||
*p='\0';
|
*p='\0';
|
||||||
|
|
||||||
if ((strstr(info.command_line, pidName) != NULL)) {
|
if ((strstr(info.command_line, pidName) != NULL)
|
||||||
|
&& (strlen(pidName) == strlen(info.command_line))) {
|
||||||
pidList=realloc( pidList, sizeof(pid_t) * (j+2));
|
pidList=realloc( pidList, sizeof(pid_t) * (j+2));
|
||||||
if (pidList==NULL)
|
if (pidList==NULL)
|
||||||
fatalError("out of memory\n");
|
fatalError("out of memory\n");
|
||||||
@ -1362,7 +1363,7 @@ extern pid_t* findPidByName( char* pidName)
|
|||||||
FILE *status;
|
FILE *status;
|
||||||
char filename[256];
|
char filename[256];
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
char* p, *q;
|
char* p;
|
||||||
|
|
||||||
/* If it isn't a number, we don't want it */
|
/* If it isn't a number, we don't want it */
|
||||||
if (!isdigit(*next->d_name))
|
if (!isdigit(*next->d_name))
|
||||||
@ -1387,8 +1388,8 @@ extern pid_t* findPidByName( char* pidName)
|
|||||||
}
|
}
|
||||||
p=buffer+6; /* Skip the "Name:\t" */
|
p=buffer+6; /* Skip the "Name:\t" */
|
||||||
|
|
||||||
if (((q=strstr(p, pidName)) != NULL)
|
if ((strstr(p, pidName) != NULL)
|
||||||
&& (strncmp(q, pidName, strlen(pidName)) != 0)) {
|
&& (strlen(pidName) == strlen(p))) {
|
||||||
pidList=realloc( pidList, sizeof(pid_t) * (i+2));
|
pidList=realloc( pidList, sizeof(pid_t) * (i+2));
|
||||||
if (pidList==NULL)
|
if (pidList==NULL)
|
||||||
fatalError("out of memory\n");
|
fatalError("out of memory\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user