aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-04-18 22:41:30 +0000
committerErik Andersen <andersen@codepoet.org>2000-04-18 22:41:30 +0000
commitb9167cb67f3316e2220cc4d209bb75880d619bc6 (patch)
tree2db48e0c162a1fab3bd00fd2c314d6e9e2d8c007
parent632bb571357c4cef455c00fb06493810284e544d (diff)
downloadbusybox-w32-b9167cb67f3316e2220cc4d209bb75880d619bc6.tar.gz
busybox-w32-b9167cb67f3316e2220cc4d209bb75880d619bc6.tar.bz2
busybox-w32-b9167cb67f3316e2220cc4d209bb75880d619bc6.zip
Really fix the killall segfault this time.
-Erik
-rw-r--r--Changelog6
-rw-r--r--utility.c9
2 files changed, 10 insertions, 5 deletions
diff --git a/Changelog b/Changelog
index e26a85039..e9d260593 100644
--- a/Changelog
+++ b/Changelog
@@ -21,6 +21,7 @@
21 * Added tr from John Lombardo <john@deltanet.com> 21 * Added tr from John Lombardo <john@deltanet.com>
22 * Added echo and test (from me). 22 * Added echo and test (from me).
23 * Added usleep contributed by Nicolas Pitre <nico@cam.org> 23 * Added usleep contributed by Nicolas Pitre <nico@cam.org>
24 * BusyBox's bss size has been majorly reduced (was 384668, is now 28740).
24 * Several fixes from Pavel Roskin <pavel_roskin@geocities.com>: 25 * Several fixes from Pavel Roskin <pavel_roskin@geocities.com>:
25 - When `tail' fails to open a file it now exits. 26 - When `tail' fails to open a file it now exits.
26 - When `syslogd' is given the `-n' option it should still use 27 - When `syslogd' is given the `-n' option it should still use
@@ -60,7 +61,10 @@
60 the common error handling saves a few bytes. Thanks to 61 the common error handling saves a few bytes. Thanks to
61 Bob Tinsley <bob@earthrise.demon.co.uk> for the patch. 62 Bob Tinsley <bob@earthrise.demon.co.uk> for the patch.
62 * Fix "+" parsing bug in date, from "Merle F. McClelland" <mfm@cts.com>. 63 * Fix "+" parsing bug in date, from "Merle F. McClelland" <mfm@cts.com>.
63 * BusyBox's bss size has been majorly reduced (was 384668, is now 28740). 64 * Fix symlink following bug in chmod -R and friends.
65 * Now allows SYSV style 'chown foo:bar' in addition to 'chown foo.bar'
66 * Fixed a bug in the busybox globbing routine such that 'find /dir -name [i]'
67 no longer segfaults.
64 68
65 69
66 -Erik Andersen 70 -Erik Andersen
diff --git a/utility.c b/utility.c
index 773f6a83e..90eec4e21 100644
--- a/utility.c
+++ b/utility.c
@@ -1315,7 +1315,8 @@ extern pid_t* findPidByName( char* pidName)
1315 if (isspace(*(p))) 1315 if (isspace(*(p)))
1316 *p='\0'; 1316 *p='\0';
1317 1317
1318 if ((strstr(info.command_line, pidName) != NULL)) { 1318 if ((strstr(info.command_line, pidName) != NULL)
1319 && (strlen(pidName) == strlen(info.command_line))) {
1319 pidList=realloc( pidList, sizeof(pid_t) * (j+2)); 1320 pidList=realloc( pidList, sizeof(pid_t) * (j+2));
1320 if (pidList==NULL) 1321 if (pidList==NULL)
1321 fatalError("out of memory\n"); 1322 fatalError("out of memory\n");
@@ -1362,7 +1363,7 @@ extern pid_t* findPidByName( char* pidName)
1362 FILE *status; 1363 FILE *status;
1363 char filename[256]; 1364 char filename[256];
1364 char buffer[256]; 1365 char buffer[256];
1365 char* p, *q; 1366 char* p;
1366 1367
1367 /* If it isn't a number, we don't want it */ 1368 /* If it isn't a number, we don't want it */
1368 if (!isdigit(*next->d_name)) 1369 if (!isdigit(*next->d_name))
@@ -1387,8 +1388,8 @@ extern pid_t* findPidByName( char* pidName)
1387 } 1388 }
1388 p=buffer+6; /* Skip the "Name:\t" */ 1389 p=buffer+6; /* Skip the "Name:\t" */
1389 1390
1390 if (((q=strstr(p, pidName)) != NULL) 1391 if ((strstr(p, pidName) != NULL)
1391 && (strncmp(q, pidName, strlen(pidName)) != 0)) { 1392 && (strlen(pidName) == strlen(p))) {
1392 pidList=realloc( pidList, sizeof(pid_t) * (i+2)); 1393 pidList=realloc( pidList, sizeof(pid_t) * (i+2));
1393 if (pidList==NULL) 1394 if (pidList==NULL)
1394 fatalError("out of memory\n"); 1395 fatalError("out of memory\n");