From 923685ac9533a8a78928c759e14acb05abcfc2e9 Mon Sep 17 00:00:00 2001 From: Owen Wang Date: Mon, 7 Feb 2000 22:20:44 +0000 Subject: [PATCH] Make CLSIDFromString return a CLSID of zeros instead of crashing when passed a null pointer. --- dlls/ole32/compobj.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index d0d352cddae..8ec347e4393 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -452,7 +452,10 @@ HRESULT WINAPI CLSIDFromString16( int i; BYTE table[256]; - TRACE("%s -> %p\n", idstr, id); + if (!s) + s = "{00000000-0000-0000-0000-000000000000}"; + + TRACE("%s -> %p\n", s, id); /* quick lookup table */ memset(table, 0, 256); @@ -467,7 +470,7 @@ HRESULT WINAPI CLSIDFromString16( /* in form {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} */ - if (strlen(idstr) != 38) + if (strlen(s) != 38) return OLE_ERROR_OBJECT; p = (BYTE *) id; -- 2.11.4.GIT