[PATCH] msvcp90: return on error (Coverity)

Marcus Meissner marcus at jet.franken.de
Sat Jan 4 11:47:11 CST 2014


Even though _invalid_parameter is supposedly always never returning,
MSDN has vague hints "if you are sure your caller can handle
continuing, you can return".... *sigh*

1147947 Dereference after null check

Ciao, Marcus
---
 dlls/msvcp90/locale.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c
index b37ead4..56d3749 100644
--- a/dlls/msvcp90/locale.c
+++ b/dlls/msvcp90/locale.c
@@ -9704,6 +9704,7 @@ size_t __cdecl mbsrtowcs(wchar_t *dst, const char **pstr, size_t n, mbstate_t *s
     {
         *_errno() = EINVAL;
         _invalid_parameter( NULL, NULL, NULL, 0, 0 );
+        return (size_t)-1;
     }
     src = *pstr;
     if (!state) state = &local_state;
-- 
1.8.4




More information about the wine-patches mailing list