From 2e497f7cae45184184e2416114887095735958f5 Mon Sep 17 00:00:00 2001 From: erik Date: Thu, 08 Feb 2007 01:45:16 +0000 Subject: Each file in this commit has a problem where it is possible to dereference a pointer without that pointer being valid. This commit fixes each instance of that. --- (limited to 'core/multimedia/opieplayer/modplug/sndfile.cpp') diff --git a/core/multimedia/opieplayer/modplug/sndfile.cpp b/core/multimedia/opieplayer/modplug/sndfile.cpp index 1d0d610..799555c 100644 --- a/core/multimedia/opieplayer/modplug/sndfile.cpp +++ b/core/multimedia/opieplayer/modplug/sndfile.cpp @@ -1739,7 +1739,10 @@ BOOL CSoundFile::SetPatternName(UINT nPat, LPCSTR lpszName) { char szName[MAX_PATTERNNAME] = ""; // changed from CHAR if (nPat >= MAX_PATTERNS) return FALSE; - if (lpszName) lstrcpyn(szName, lpszName, MAX_PATTERNNAME); + if (lpszName) + lstrcpyn(szName, lpszName, MAX_PATTERNNAME); + else + return FALSE; szName[MAX_PATTERNNAME-1] = 0; if (!m_lpszPatternNames) m_nPatternNames = 0; if (nPat >= m_nPatternNames) -- cgit v0.9.0.2