[PATCH] msvcp90: return on error (Coverity) (resubmit)

Marcus Meissner marcus at jet.franken.de
Sat Jan 4 11:48:42 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*

resubmit with the other function also included.

1147947 Dereference after null check
1147948 Dereference after null check

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

diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c
index b37ead4..95ffab0 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;
@@ -9747,6 +9748,7 @@ size_t __cdecl wcsrtombs(char *dst, const wchar_t **pstr, size_t n, mbstate_t *s
     {
         *_errno() = EINVAL;
         _invalid_parameter( NULL, NULL, NULL, 0, 0 );
+        return (size_t)-1;
     }
     src = *pstr;
 
-- 
1.8.4




More information about the wine-patches mailing list