https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a120d67d0e71856306c4d…
commit a120d67d0e71856306c4dc41ecaac5fd541c9049
Author: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr>
AuthorDate: Wed Jun 24 20:41:44 2020 +0200
Commit: George Bișoc <george.bisoc(a)reactos.org>
CommitDate: Sat Apr 24 20:30:58 2021 +0200
[USRMGR] Increase name sizes to 'UNLEN + 1'
---
dll/cpl/usrmgr/groupprops.c | 12 ++++++------
dll/cpl/usrmgr/groups.c | 14 +++++++-------
dll/cpl/usrmgr/userprops.c | 12 ++++++------
dll/cpl/usrmgr/users.c | 18 +++++++++---------
4 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/dll/cpl/usrmgr/groupprops.c b/dll/cpl/usrmgr/groupprops.c
index f888beb36ae..2ae227ae512 100644
--- a/dll/cpl/usrmgr/groupprops.c
+++ b/dll/cpl/usrmgr/groupprops.c
@@ -155,7 +155,7 @@ AddSelectedUsersToGroup(HWND hwndDlg,
HWND hwndLV;
INT nSelectedItems;
INT nItem;
- TCHAR szUserName[UNLEN];
+ TCHAR szUserName[UNLEN + 1];
BOOL bResult = FALSE;
LOCALGROUP_MEMBERS_INFO_3 memberInfo;
NET_API_STATUS status;
@@ -172,7 +172,7 @@ AddSelectedUsersToGroup(HWND hwndDlg,
ListView_GetItemText(hwndLV,
nItem, 0,
szUserName,
- UNLEN);
+ UNLEN + 1);
DebugPrintf(_TEXT("Selected user: %s"), szUserName);
@@ -310,7 +310,7 @@ static VOID
RemoveUserFromGroup(HWND hwndDlg,
PGENERAL_GROUP_DATA pGroupData)
{
- TCHAR szUserName[UNLEN];
+ TCHAR szUserName[UNLEN + 1];
TCHAR szText[256];
LOCALGROUP_MEMBERS_INFO_3 memberInfo;
HWND hwndLV;
@@ -326,7 +326,7 @@ RemoveUserFromGroup(HWND hwndDlg,
ListView_GetItemText(hwndLV,
nItem, 0,
szUserName,
- UNLEN);
+ UNLEN + 1);
/* Display a warning message because the remove operation cannot be reverted */
wsprintf(szText, TEXT("Do you really want to remove the user \"%s\"
from the group \"%s\"?"),
@@ -612,7 +612,7 @@ GroupProperties(HWND hwndDlg)
{
PROPSHEETPAGE psp[1];
PROPSHEETHEADER psh;
- TCHAR szGroupName[UNLEN];
+ TCHAR szGroupName[UNLEN + 1];
INT nItem;
HWND hwndLV;
@@ -625,7 +625,7 @@ GroupProperties(HWND hwndDlg)
ListView_GetItemText(hwndLV,
nItem, 0,
szGroupName,
- UNLEN);
+ UNLEN + 1);
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
psh.dwSize = sizeof(PROPSHEETHEADER);
diff --git a/dll/cpl/usrmgr/groups.c b/dll/cpl/usrmgr/groups.c
index 73ce4e1368d..44423038b84 100644
--- a/dll/cpl/usrmgr/groups.c
+++ b/dll/cpl/usrmgr/groups.c
@@ -90,7 +90,7 @@ UpdateGroupsList(HWND hwndListView)
static VOID
UpdateGroupProperties(HWND hwndDlg)
{
- TCHAR szGroupName[UNLEN];
+ TCHAR szGroupName[UNLEN + 1];
INT iItem;
HWND hwndLV;
PLOCALGROUP_INFO_1 pGroupInfo = NULL;
@@ -104,7 +104,7 @@ UpdateGroupProperties(HWND hwndDlg)
ListView_GetItemText(hwndLV,
iItem, 0,
szGroupName,
- UNLEN);
+ UNLEN + 1);
NetLocalGroupGetInfo(NULL, szGroupName, 1, (LPBYTE*)&pGroupInfo);
@@ -254,7 +254,7 @@ GroupRename(HWND hwndDlg)
static BOOL
GroupDelete(HWND hwndDlg)
{
- TCHAR szGroupName[UNLEN];
+ TCHAR szGroupName[UNLEN + 1];
TCHAR szText[256];
INT nItem;
HWND hwndLV;
@@ -269,7 +269,7 @@ GroupDelete(HWND hwndDlg)
ListView_GetItemText(hwndLV,
nItem, 0,
szGroupName,
- UNLEN);
+ UNLEN + 1);
/* Display a warning message, because the delete operation cannot be reverted */
wsprintf(szText, TEXT("Dou you really want to delete the user group
\"%s\"?"), szGroupName);
@@ -336,8 +336,8 @@ OnGroupsPageBeginLabelEdit(LPNMLVDISPINFO pnmv)
static BOOL
OnGroupsPageEndLabelEdit(LPNMLVDISPINFO pnmv)
{
- TCHAR szOldGroupName[UNLEN];
- TCHAR szNewGroupName[UNLEN];
+ TCHAR szOldGroupName[UNLEN + 1];
+ TCHAR szNewGroupName[UNLEN + 1];
LOCALGROUP_INFO_0 lgrpi0;
NET_API_STATUS status;
@@ -349,7 +349,7 @@ OnGroupsPageEndLabelEdit(LPNMLVDISPINFO pnmv)
ListView_GetItemText(pnmv->hdr.hwndFrom,
pnmv->item.iItem, 0,
szOldGroupName,
- UNLEN);
+ UNLEN + 1);
/* Leave, if the user canceled the edit action */
if (pnmv->item.pszText == NULL)
diff --git a/dll/cpl/usrmgr/userprops.c b/dll/cpl/usrmgr/userprops.c
index 44a3abcb40b..37819c52be8 100644
--- a/dll/cpl/usrmgr/userprops.c
+++ b/dll/cpl/usrmgr/userprops.c
@@ -316,7 +316,7 @@ static VOID
RemoveGroupFromUser(HWND hwndDlg,
PMEMBERSHIP_USER_DATA pUserData)
{
- TCHAR szGroupName[UNLEN];
+ TCHAR szGroupName[UNLEN + 1];
TCHAR szText[256];
LOCALGROUP_MEMBERS_INFO_3 memberInfo;
HWND hwndLV;
@@ -332,7 +332,7 @@ RemoveGroupFromUser(HWND hwndDlg,
ListView_GetItemText(hwndLV,
nItem, 0,
szGroupName,
- UNLEN);
+ UNLEN + 1);
/* Display a warning message because the remove operation cannot be reverted */
wsprintf(szText, TEXT("Do you really want to remove the user \"%s\"
from the group \"%s\"?"),
@@ -441,7 +441,7 @@ AddSelectedGroupsToUser(HWND hwndDlg,
{
HWND hwndLV;
INT nItem;
- TCHAR szGroupName[UNLEN];
+ TCHAR szGroupName[UNLEN + 1];
BOOL bResult = FALSE;
BOOL bFound;
DWORD i;
@@ -459,7 +459,7 @@ AddSelectedGroupsToUser(HWND hwndDlg,
ListView_GetItemText(hwndLV,
nItem, 0,
szGroupName,
- UNLEN);
+ UNLEN + 1);
bFound = FALSE;
for (i = 0; i < pUserData->dwGroupCount; i++)
@@ -902,7 +902,7 @@ UserProperties(HWND hwndDlg)
{
PROPSHEETPAGE psp[3];
PROPSHEETHEADER psh;
- TCHAR szUserName[UNLEN];
+ TCHAR szUserName[UNLEN + 1];
INT nItem;
HWND hwndLV;
@@ -915,7 +915,7 @@ UserProperties(HWND hwndDlg)
ListView_GetItemText(hwndLV,
nItem, 0,
szUserName,
- UNLEN);
+ UNLEN + 1);
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
psh.dwSize = sizeof(PROPSHEETHEADER);
diff --git a/dll/cpl/usrmgr/users.c b/dll/cpl/usrmgr/users.c
index c137e66ce49..084743e72f8 100644
--- a/dll/cpl/usrmgr/users.c
+++ b/dll/cpl/usrmgr/users.c
@@ -109,7 +109,7 @@ ChangePasswordDlgProc(HWND hwndDlg,
static VOID
UserChangePassword(HWND hwndDlg)
{
- TCHAR szUserName[UNLEN];
+ TCHAR szUserName[UNLEN + 1];
USER_INFO_1003 user;
INT nItem;
HWND hwndLV;
@@ -126,7 +126,7 @@ UserChangePassword(HWND hwndDlg)
ListView_GetItemText(hwndLV,
nItem, 0,
szUserName,
- UNLEN);
+ UNLEN + 1);
if (DialogBoxParam(hApplet,
MAKEINTRESOURCE(IDD_CHANGE_PASSWORD),
@@ -386,7 +386,7 @@ UserRename(HWND hwndDlg)
static BOOL
UserDelete(HWND hwndDlg)
{
- TCHAR szUserName[UNLEN];
+ TCHAR szUserName[UNLEN + 1];
TCHAR szText[256];
INT nItem;
HWND hwndLV;
@@ -401,7 +401,7 @@ UserDelete(HWND hwndDlg)
ListView_GetItemText(hwndLV,
nItem, 0,
szUserName,
- UNLEN);
+ UNLEN + 1);
/* Display a warning message because the delete operation cannot be reverted */
wsprintf(szText, TEXT("Do you really want to delete the user
\"%s\"?"), szUserName);
@@ -550,8 +550,8 @@ OnBeginLabelEdit(LPNMLVDISPINFO pnmv)
static BOOL
OnEndLabelEdit(LPNMLVDISPINFO pnmv)
{
- TCHAR szOldUserName[UNLEN];
- TCHAR szNewUserName[UNLEN];
+ TCHAR szOldUserName[UNLEN + 1];
+ TCHAR szNewUserName[UNLEN + 1];
USER_INFO_0 useri0;
NET_API_STATUS status;
@@ -563,7 +563,7 @@ OnEndLabelEdit(LPNMLVDISPINFO pnmv)
ListView_GetItemText(pnmv->hdr.hwndFrom,
pnmv->item.iItem, 0,
szOldUserName,
- UNLEN);
+ UNLEN + 1);
/* Leave, if the user canceled the edit action */
if (pnmv->item.pszText == NULL)
@@ -649,7 +649,7 @@ OnNotify(HWND hwndDlg, PUSER_DATA pUserData, NMHDR *phdr)
static VOID
UpdateUserProperties(HWND hwndDlg)
{
- TCHAR szUserName[UNLEN];
+ TCHAR szUserName[UNLEN + 1];
INT iItem;
HWND hwndLV;
PUSER_INFO_2 pUserInfo = NULL;
@@ -664,7 +664,7 @@ UpdateUserProperties(HWND hwndDlg)
ListView_GetItemText(hwndLV,
iItem, 0,
szUserName,
- UNLEN);
+ UNLEN + 1);
NetUserGetInfo(NULL, szUserName, 2, (LPBYTE*)&pUserInfo);