fuser: a bit of safety in scanf

This commit is contained in:
Denis Vlasenko 2008-07-12 09:32:38 +00:00
parent a46dd89e94
commit 6b7971805c

View File

@ -114,7 +114,7 @@ static inode_list *scan_proc_net(const char *proto,
return ilist; return ilist;
while (fgets(line, MAX_LINE, f)) { while (fgets(line, MAX_LINE, f)) {
char addr[64]; char addr[68];
if (sscanf(line, "%*d: %64[0-9A-Fa-f]:%x %*x:%*x %*x %*x:%*x " if (sscanf(line, "%*d: %64[0-9A-Fa-f]:%x %*x:%*x %*x %*x:%*x "
"%*x:%*x %*x %*d %*d %llu", "%*x:%*x %*x %*d %*d %llu",
addr, &tmp_port, &uint64_inode) == 3 addr, &tmp_port, &uint64_inode) == 3