Marcus Meissner : shell32: handle corrupt entry in iconcache registry entry (Coverity).

Alexandre Julliard julliard at winehq.org
Fri Dec 4 09:11:28 CST 2009


Module: wine
Branch: master
Commit: 265c959ed9471aec87ba5da8ff9bcb1e3c4bb07e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=265c959ed9471aec87ba5da8ff9bcb1e3c4bb07e

Author: Marcus Meissner <marcus at jet.franken.de>
Date:   Thu Dec  3 23:47:31 2009 +0100

shell32: handle corrupt entry in iconcache registry entry (Coverity).

---

 dlls/shell32/iconcache.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/dlls/shell32/iconcache.c b/dlls/shell32/iconcache.c
index b51ff06..c4087d2 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);
 	    }




More information about the wine-cvs mailing list