]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Don't crash if data is not valid.
authorToni Wilen <twilen@winuae.net>
Wed, 21 Jun 2017 17:46:47 +0000 (20:46 +0300)
committerToni Wilen <twilen@winuae.net>
Wed, 21 Jun 2017 17:46:47 +0000 (20:46 +0300)
od-win32/registry.cpp

index 24b382b404f8fe43f136ed1cf616bc8390eb7ba6..498dc6e814e5f0e4fb39baefd3d322c41c20de54 100644 (file)
@@ -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);