From: Toni Wilen Date: Wed, 21 Jun 2017 17:46:47 +0000 (+0300) Subject: Don't crash if data is not valid. X-Git-Tag: 3600~182 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=8bfe1e769400a626df363576324baaf4465bfe6c;p=francis%2Fwinuae.git Don't crash if data is not valid. --- diff --git a/od-win32/registry.cpp b/od-win32/registry.cpp index 24b382b4..498dc6e8 100644 --- a/od-win32/registry.cpp +++ b/od-win32/registry.cpp @@ -167,10 +167,12 @@ int regenumstr (UAEREG *root, int idx, TCHAR *name, int *nsize, TCHAR *str, int } if (p[0]) { p2 = _tcschr (p, '='); - *p2++ = 0; - _tcscpy_s (name, *nsize, p); - _tcscpy_s (str, *size, p2); - ret = 1; + if (p2) { + *p2++ = 0; + _tcscpy_s (name, *nsize, p); + _tcscpy_s (str, *size, p2); + ret = 1; + } } } xfree (tmp);