From 9005713d3972af5427d3674cfee6d9f232d1cf6f Mon Sep 17 00:00:00 2001 From: Gerard Patel Date: Tue, 19 Sep 2000 02:37:07 +0000 Subject: [PATCH] Avoid infinite loop if QueryPathOfRegTypeLib is called with lcid=0. --- dlls/oleaut32/typelib.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 364655fea76..4a0718cf153 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -5,7 +5,7 @@ * 1999 Rein Klazes * there is much left to do here before it can be useful for real world * programs - * know problems: + * known problems: * -. Only one format of typelibs is supported * -. All testing so far is done using special written windows programs * -. Data structures are straightforward, but slow for look-ups. @@ -131,7 +131,9 @@ QueryPathOfRegTypeLib( if (RegQueryValueA(HKEY_LOCAL_MACHINE, szTypeLibKey, szPath, &dwPathLen)) { - if (myLCID == lcid) + if (!lcid) + break; + else if (myLCID == lcid) { /* try with sub-langid */ myLCID = SUBLANGID(lcid); @@ -161,7 +163,7 @@ QueryPathOfRegTypeLib( hr = S_OK; } } - + TRACE_(typelib)("%s not found\n", szTypeLibKey); return hr; }