iphlpapi: Fix possible Out-of-bounds write (Coverity)

André Hentschel nerv at dawncrow.de
Sun Jul 19 16:21:37 CDT 2015


731797
---
 dlls/iphlpapi/ipstats.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
index 3ff30f3..5965bf9 100644
--- a/dlls/iphlpapi/ipstats.c
+++ b/dlls/iphlpapi/ipstats.c
@@ -1989,7 +1989,7 @@ static unsigned int find_owning_pid( struct pid_map *map, unsigned int num_entri
                 int len;
 
                 sprintf( link, "/proc/%u/fd/%s", map[i].unix_pid, dirent->d_name );
-                if ((len = readlink( link, name, 32 )) > 0) name[len] = 0;
+                if ((len = readlink( link, name, sizeof(name) - 1 )) > 0) name[len] = 0;
                 if (len == len_socket && !strcmp( socket, name ))
                 {
                     closedir( dirfd );
-- 
1.9.1




More information about the wine-patches mailing list