From 265c959ed9471aec87ba5da8ff9bcb1e3c4bb07e Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Thu, 3 Dec 2009 23:47:31 +0100 Subject: [PATCH] shell32: handle corrupt entry in iconcache registry entry (Coverity). --- dlls/shell32/iconcache.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dlls/shell32/iconcache.c b/dlls/shell32/iconcache.c index b51ff064c28..c4087d25f54 100644 --- a/dlls/shell32/iconcache.c +++ b/dlls/shell32/iconcache.c @@ -495,9 +495,13 @@ static int SIC_LoadOverlayIcon(int icon_idx) { LPWSTR p = strchrW(buffer, ','); - if (p) - *p++ = 0; - + if (!p) + { + ERR("Icon index in %s/%s corrupted, no comma.\n", debugstr_w(wszShellIcons),debugstr_w(wszIdx)); + RegCloseKey(hKeyShellIcons); + return -1; + } + *p++ = 0; iconPath = buffer; iconIdx = atoiW(p); } -- 2.11.4.GIT