Module: wine Branch: master Commit: 88bd52daafe15c948c436496c1cbb9ec133fed57 URL: http://source.winehq.org/git/wine.git/?a=commit;h=88bd52daafe15c948c436496c1...
Author: Marcus Meissner marcus@jet.franken.de Date: Mon Nov 23 09:59:14 2009 +0100
uxtheme: Handle malformed keys a bit better (Coverity).
---
dlls/uxtheme/msstyles.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/uxtheme/msstyles.c b/dlls/uxtheme/msstyles.c index 825645d..896a294 100644 --- a/dlls/uxtheme/msstyles.c +++ b/dlls/uxtheme/msstyles.c @@ -364,7 +364,10 @@ static BOOL MSSTYLES_ParseIniSectionName(LPCWSTR lpSection, DWORD dwLen, LPWSTR lstrcpynW(part, comp, sizeof(part)/sizeof(part[0])); comp = tmp; /* now get the state */ - *strchrW(comp, ')') = 0; + tmp = strchrW(comp, ')'); + if (!tmp) + return FALSE; + *tmp = 0; lstrcpynW(state, comp, sizeof(state)/sizeof(state[0])); } else { @@ -378,7 +381,10 @@ static BOOL MSSTYLES_ParseIniSectionName(LPCWSTR lpSection, DWORD dwLen, LPWSTR lstrcpynW(szClassName, comp, MAX_THEME_CLASS_NAME); comp = tmp; /* now get the state */ - *strchrW(comp, ')') = 0; + tmp = strchrW(comp, ')'); + if (!tmp) + return FALSE; + *tmp = 0; lstrcpynW(state, comp, sizeof(state)/sizeof(state[0])); } else {