[PATCH] dpnet: Initialize size variable. (Coverity)
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> --- dlls/dpnet/peer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/dpnet/peer.c b/dlls/dpnet/peer.c index f935b2a313..3df07749c5 100644 --- a/dlls/dpnet/peer.c +++ b/dlls/dpnet/peer.c @@ -157,6 +157,7 @@ HRESULT enum_services_providers(const GUID * const service, DPN_SERVICE_PROVIDER next_key = RegEnumKeyW( key, index, provider, MAX_PATH); while(next_key == ERROR_SUCCESS) { + size = 0; res = RegGetValueW(key, provider, friendly, RRF_RT_REG_SZ, NULL, NULL, &size); if(res == ERROR_SUCCESS) { -- 2.20.1
On 16-06-19 08:49, Alistair Leslie-Hughes wrote:
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> --- dlls/dpnet/peer.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/dpnet/peer.c b/dlls/dpnet/peer.c index f935b2a313..3df07749c5 100644 --- a/dlls/dpnet/peer.c +++ b/dlls/dpnet/peer.c @@ -157,6 +157,7 @@ HRESULT enum_services_providers(const GUID * const service, DPN_SERVICE_PROVIDER next_key = RegEnumKeyW( key, index, provider, MAX_PATH); while(next_key == ERROR_SUCCESS) { + size = 0; res = RegGetValueW(key, provider, friendly, RRF_RT_REG_SZ, NULL, NULL, &size); if(res == ERROR_SUCCESS) { Wouldn't it be more correct to fix RegGetValueW to do
cbData = (pcbData && pvData) ? *pcbData : 0; instead of cbData = pcbData ? *pcbData : 0; instead? RegQueryValueExW does something similar.
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=53757 Your paranoid android. === debian9 (build log) === error: patch failed: dlls/dpnet/peer.c:157 Task: Patch failed to apply === debian9 (build log) === error: patch failed: dlls/dpnet/peer.c:157 Task: Patch failed to apply
Thanks. I'll have a look at fixing RegGetValueW. Regards Alistair From: Sven Baars Sent: Sunday, 16 June, 20:01 Subject: Re: [PATCH] dpnet: Initialize size variable. (Coverity) To: Alistair Leslie-Hughes, wine-devel(a)winehq.org On 16-06-19 08:49, Alistair Leslie-Hughes wrote: Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com><mailto:leslie_alistair(a)hotmail.com> --- dlls/dpnet/peer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/dpnet/peer.c b/dlls/dpnet/peer.c index f935b2a313..3df07749c5 100644 --- a/dlls/dpnet/peer.c +++ b/dlls/dpnet/peer.c @@ -157,6 +157,7 @@ HRESULT enum_services_providers(const GUID * const service, DPN_SERVICE_PROVIDER next_key = RegEnumKeyW( key, index, provider, MAX_PATH); while(next_key == ERROR_SUCCESS) { + size = 0; res = RegGetValueW(key, provider, friendly, RRF_RT_REG_SZ, NULL, NULL, &size); if(res == ERROR_SUCCESS) { Wouldn't it be more correct to fix RegGetValueW to do cbData = (pcbData && pvData) ? *pcbData : 0; instead of cbData = pcbData ? *pcbData : 0; instead? RegQueryValueExW does something similar.
participants (3)
-
Alistair Leslie-Hughes -
Marvin -
Sven Baars