From 031935bc29d98246fd5c26a5966427390f487c28 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sun, 6 Sep 2015 12:54:22 +0200 Subject: [PATCH] Added patch to fix possible memory leak in netprofm init_networks. --- debian/changelog | 1 + ...sible-memory-leak-in-init_networks-C.patch | 25 +++++++++++++++++++ patches/patchinstall.sh | 16 ++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 patches/netprofm-Coverity/0001-netprofm-Fix-possible-memory-leak-in-init_networks-C.patch diff --git a/debian/changelog b/debian/changelog index 4f762c54..6ed513d9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -34,6 +34,7 @@ wine-staging (1.7.51) UNRELEASED; urgency=low * Added patch to implement {Set,Get}ThreadGroupAffinity and related ntdll functions. * Added patch to properly render themed buttons when they are pressed. + * Added patch to fix possible memory leak in netprofm init_networks. * Removed patch to fix bug in wineserver debug_children inheritance (accepted upstream). * Removed patch to use helper function for NtWaitForMultipleObjects and diff --git a/patches/netprofm-Coverity/0001-netprofm-Fix-possible-memory-leak-in-init_networks-C.patch b/patches/netprofm-Coverity/0001-netprofm-Fix-possible-memory-leak-in-init_networks-C.patch new file mode 100644 index 00000000..11dca1db --- /dev/null +++ b/patches/netprofm-Coverity/0001-netprofm-Fix-possible-memory-leak-in-init_networks-C.patch @@ -0,0 +1,25 @@ +From f92787d0eccc628d95a99f0e0db958f9af563c23 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sun, 6 Sep 2015 12:53:26 +0200 +Subject: netprofm: Fix possible memory leak in init_networks (Coverity). + +--- + dlls/netprofm/list.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/netprofm/list.c b/dlls/netprofm/list.c +index 197ef68..c30522d 100644 +--- a/dlls/netprofm/list.c ++++ b/dlls/netprofm/list.c +@@ -1681,7 +1681,7 @@ static void init_networks( struct list_manager *mgr ) + if (ret != ERROR_BUFFER_OVERFLOW) return; + + if (!(buf = heap_alloc( size ))) return; +- if (GetAdaptersAddresses( WS_AF_UNSPEC, flags, NULL, buf, &size )) return; ++ if (GetAdaptersAddresses( WS_AF_UNSPEC, flags, NULL, buf, &size )) goto done; + + memset( &id, 0, sizeof(id) ); + for (aa = buf; aa; aa = aa->Next) +-- +2.5.1 + diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index ce844f0a..009d29bb 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -173,6 +173,7 @@ patch_enable_all () enable_msvcrt_Math_Precision="$1" enable_msvcrt_StdHandle_RefCount="$1" enable_msvfw32_Image_Size="$1" + enable_netprofm_Coverity="$1" enable_ntdll_APC_Performance="$1" enable_ntdll_APC_Start_Process="$1" enable_ntdll_Activation_Context="$1" @@ -613,6 +614,9 @@ patch_enable () msvfw32-Image_Size) enable_msvfw32_Image_Size="$2" ;; + netprofm-Coverity) + enable_netprofm_Coverity="$2" + ;; ntdll-APC_Performance) enable_ntdll_APC_Performance="$2" ;; @@ -3743,6 +3747,18 @@ if test "$enable_msvfw32_Image_Size" -eq 1; then ) >> "$patchlist" fi +# Patchset netprofm-Coverity +# | +# | Modified files: +# | * dlls/netprofm/list.c +# | +if test "$enable_netprofm_Coverity" -eq 1; then + patch_apply netprofm-Coverity/0001-netprofm-Fix-possible-memory-leak-in-init_networks-C.patch + ( + echo '+ { "Sebastian Lackner", "netprofm: Fix possible memory leak in init_networks (Coverity).", 1 },'; + ) >> "$patchlist" +fi + # Patchset ntdll-APC_Performance # | # | Modified files: