提交 74f5e8cd 编写于 作者: P prr

8149714: [parfait] char array lengths don't match in awt_Font.cpp:1701

Reviewed-by: serb, ssadetsky
上级 bfaf0af4
...@@ -1651,6 +1651,8 @@ CSegTable* CSegTableManager::GetTable(LPCWSTR lpszFontName, BOOL fEUDC) ...@@ -1651,6 +1651,8 @@ CSegTable* CSegTableManager::GetTable(LPCWSTR lpszFontName, BOOL fEUDC)
CSegTableManager g_segTableManager; CSegTableManager g_segTableManager;
#define KEYLEN 16
class CCombinedSegTable : public CSegTableComponent class CCombinedSegTable : public CSegTableComponent
{ {
public: public:
...@@ -1661,7 +1663,7 @@ public: ...@@ -1661,7 +1663,7 @@ public:
private: private:
LPSTR GetCodePageSubkey(); LPSTR GetCodePageSubkey();
void GetEUDCFileName(LPWSTR lpszFileName, int cchFileName); void GetEUDCFileName(LPWSTR lpszFileName, int cchFileName);
static char m_szCodePageSubkey[16]; static char m_szCodePageSubkey[KEYLEN];
static WCHAR m_szDefaultEUDCFile[_MAX_PATH]; static WCHAR m_szDefaultEUDCFile[_MAX_PATH];
static BOOL m_fEUDCSubKeyExist; static BOOL m_fEUDCSubKeyExist;
static BOOL m_fTTEUDCFileExist; static BOOL m_fTTEUDCFileExist;
...@@ -1669,7 +1671,7 @@ private: ...@@ -1669,7 +1671,7 @@ private:
CEUDCSegTable* m_pEUDCSegTable; CEUDCSegTable* m_pEUDCSegTable;
}; };
char CCombinedSegTable::m_szCodePageSubkey[16] = ""; char CCombinedSegTable::m_szCodePageSubkey[KEYLEN] = "";
WCHAR CCombinedSegTable::m_szDefaultEUDCFile[_MAX_PATH] = L""; WCHAR CCombinedSegTable::m_szDefaultEUDCFile[_MAX_PATH] = L"";
...@@ -1701,8 +1703,11 @@ LPSTR CCombinedSegTable::GetCodePageSubkey() ...@@ -1701,8 +1703,11 @@ LPSTR CCombinedSegTable::GetCodePageSubkey()
} }
lpszCP++; // cf lpszCP = "932" lpszCP++; // cf lpszCP = "932"
char szSubKey[80]; char szSubKey[KEYLEN];
strcpy(szSubKey, "EUDC\\"); strcpy(szSubKey, "EUDC\\");
if ((strlen(szSubKey) + strlen(lpszCP)) >= KEYLEN) {
return NULL;
}
strcpy(&(szSubKey[strlen(szSubKey)]), lpszCP); strcpy(&(szSubKey[strlen(szSubKey)]), lpszCP);
strcpy(m_szCodePageSubkey, szSubKey); strcpy(m_szCodePageSubkey, szSubKey);
return m_szCodePageSubkey; return m_szCodePageSubkey;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册