=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: iphlpapi: Fix possible Out-of-bounds write (Coverity).

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jul 20 14:20:48 CDT 2015


Module: wine
Branch: master
Commit: 10b91549ed7193ec3e2ac0257bb65b4f3fa32c8c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=10b91549ed7193ec3e2ac0257bb65b4f3fa32c8c

Author: André Hentschel <nerv at dawncrow.de>
Date:   Sun Jul 19 23:21:37 2015 +0200

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

---

 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 );




More information about the wine-cvs mailing list