From 149282db31fd9b6be2142d21cac98bae97ce9a4d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 14 Jul 2020 21:32:30 +0300 Subject: =?UTF-8?q?fixes=20#2421=20(=D0=A1=D0=BF=D0=B8=D1=81=D0=BE=D0=BA?= =?UTF-8?q?=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B0=D0=BA=D1=82=D0=BE=D0=B2=20?= =?UTF-8?q?=D0=BD=D0=B5=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B0?= =?UTF-8?q?=D0=B5=D1=82=20=D0=B3=D1=80=D1=83=D0=BF=D0=BF=D1=8B=20=D1=81=20?= =?UTF-8?q?=D0=B4=D0=BB=D0=B8=D0=BD=D0=BD=D1=8B=D0=BC=D0=B8=20=D0=BD=D0=B0?= =?UTF-8?q?=D0=B8=D0=BC=D0=B5=D0=BD=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=D0=BC=D0=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mir_app/src/clistgroups.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mir_app/src/clistgroups.cpp b/src/mir_app/src/clistgroups.cpp index 4a308edb28..9040e2b048 100644 --- a/src/mir_app/src/clistgroups.cpp +++ b/src/mir_app/src/clistgroups.cpp @@ -25,12 +25,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" #include "clc.h" +#define MAX_GROUPNAME_LEN 256 + struct CGroupInternal { CGroupInternal(int _id, const wchar_t *_name) : groupId(_id), groupName(mir_wstrdup(_name)) - {} + {} ~CGroupInternal() { mir_free(groupName); @@ -103,7 +105,7 @@ MIR_APP_DLL(MGROUP) Clist_GroupExists(LPCTSTR ptszGroupName) static INT_PTR CreateGroupInternal(MGROUP hParent, const wchar_t *ptszName) { - wchar_t newBaseName[127], newName[128]; + wchar_t newBaseName[MAX_GROUPNAME_LEN-1], newName[MAX_GROUPNAME_LEN]; const wchar_t *grpName = ptszName ? ptszName : TranslateT("New group"); if (hParent) { @@ -461,7 +463,7 @@ MIR_APP_DLL(HMENU) Clist_GroupBuildMenu() MENUITEMINFO mii = { 0 }; mii.cbSize = sizeof(mii); - wchar_t szThisField[128], szThisMenuItem[128]; + wchar_t szThisField[MAX_GROUPNAME_LEN], szThisMenuItem[MAX_GROUPNAME_LEN]; do { const wchar_t *pBackslash = wcschr(pNextField, '\\'); if (pBackslash == nullptr) { -- cgit v1.2.3