diff options
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; |