diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-12 09:20:44 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-12 09:20:44 +0000 |
commit | a46dd89e9451ec73a4df54427110cdfc28d8b031 (patch) | |
tree | 2e470b3c0236524905a6d399c5207cccaef2fc7b /procps | |
parent | 39acf453353a41a78fbc220360e884eb0eb33a59 (diff) | |
download | busybox-w32-a46dd89e9451ec73a4df54427110cdfc28d8b031.tar.gz busybox-w32-a46dd89e9451ec73a4df54427110cdfc28d8b031.tar.bz2 busybox-w32-a46dd89e9451ec73a4df54427110cdfc28d8b031.zip |
cpio: internalize archive_xread_all_eof. add a few paranoia checks
for corrupted cpio files.
modprobe-small: remove stray include
route: small code shrink
function old new delta
get_header_cpio 958 980 +22
archive_xread_all_eof 33 - -33
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/0 up/down: 22/-33) Total: -11 bytes
Diffstat (limited to 'procps')
-rw-r--r-- | procps/fuser.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/procps/fuser.c b/procps/fuser.c index 8afa958b6..d8005b568 100644 --- a/procps/fuser.c +++ b/procps/fuser.c | |||
@@ -100,7 +100,6 @@ static inode_list *scan_proc_net(const char *proto, | |||
100 | unsigned port, inode_list *ilist) | 100 | unsigned port, inode_list *ilist) |
101 | { | 101 | { |
102 | char path[20], line[MAX_LINE + 1]; | 102 | char path[20], line[MAX_LINE + 1]; |
103 | char addr[128]; | ||
104 | ino_t tmp_inode; | 103 | ino_t tmp_inode; |
105 | dev_t tmp_dev; | 104 | dev_t tmp_dev; |
106 | long long uint64_inode; | 105 | long long uint64_inode; |
@@ -115,13 +114,15 @@ static inode_list *scan_proc_net(const char *proto, | |||
115 | return ilist; | 114 | return ilist; |
116 | 115 | ||
117 | while (fgets(line, MAX_LINE, f)) { | 116 | while (fgets(line, MAX_LINE, f)) { |
117 | char addr[64]; | ||
118 | if (sscanf(line, "%*d: %64[0-9A-Fa-f]:%x %*x:%*x %*x %*x:%*x " | 118 | if (sscanf(line, "%*d: %64[0-9A-Fa-f]:%x %*x:%*x %*x %*x:%*x " |
119 | "%*x:%*x %*x %*d %*d %llu", | 119 | "%*x:%*x %*x %*d %*d %llu", |
120 | addr, &tmp_port, &uint64_inode) == 3 | 120 | addr, &tmp_port, &uint64_inode) == 3 |
121 | ) { | 121 | ) { |
122 | if (strlen(addr) == 8 && (option_mask32 & OPT_IP6)) | 122 | int len = strlen(addr); |
123 | if (len == 8 && (option_mask32 & OPT_IP6)) | ||
123 | continue; | 124 | continue; |
124 | if (strlen(addr) > 8 && (option_mask32 & OPT_IP4)) | 125 | if (len > 8 && (option_mask32 & OPT_IP4)) |
125 | continue; | 126 | continue; |
126 | if (tmp_port == port) { | 127 | if (tmp_port == port) { |
127 | tmp_inode = uint64_inode; | 128 | tmp_inode = uint64_inode; |