mirror of
https://github.com/samba-team/samba.git
synced 2025-09-10 05:44:20 +03:00
Add static, and assert that we will never overflow the static fstring
in pdb_encode_acct_ctrl() (All current callers are fine) Andrew Bartlett
This commit is contained in:
@@ -412,7 +412,7 @@ NTSTATUS pdb_free_sam(SAM_ACCOUNT **user)
|
|||||||
* SSS
|
* SSS
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
NTSTATUS pdb_set_sam_sids(SAM_ACCOUNT *account_data, const struct passwd *pwd)
|
static NTSTATUS pdb_set_sam_sids(SAM_ACCOUNT *account_data, const struct passwd *pwd)
|
||||||
{
|
{
|
||||||
const char *guest_account = lp_guestaccount();
|
const char *guest_account = lp_guestaccount();
|
||||||
GROUP_MAP map;
|
GROUP_MAP map;
|
||||||
@@ -475,6 +475,9 @@ NTSTATUS pdb_set_sam_sids(SAM_ACCOUNT *account_data, const struct passwd *pwd)
|
|||||||
char *pdb_encode_acct_ctrl(uint16 acct_ctrl, size_t length)
|
char *pdb_encode_acct_ctrl(uint16 acct_ctrl, size_t length)
|
||||||
{
|
{
|
||||||
static fstring acct_str;
|
static fstring acct_str;
|
||||||
|
|
||||||
|
SMB_ASSERT(length <= sizeof(acct_str));
|
||||||
|
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
|
|
||||||
acct_str[i++] = '[';
|
acct_str[i++] = '[';
|
||||||
|
Reference in New Issue
Block a user