summaryrefslogtreecommitdiffstats
path: root/source/nmbd/nmbd_processlogon.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-03-27 12:38:45 +0000
committerAndrew Tridgell <tridge@samba.org>2000-03-27 12:38:45 +0000
commit426c90433396a95033eefcc4af97603abc934221 (patch)
tree1eb354b315679f9e93fc9acb1f47ebfba182f489 /source/nmbd/nmbd_processlogon.c
parentf6b56ae93e47a54317f2711533ec8208d5cbc8a9 (diff)
downloadsamba-426c90433396a95033eefcc4af97603abc934221.tar.gz
samba-426c90433396a95033eefcc4af97603abc934221.tar.xz
samba-426c90433396a95033eefcc4af97603abc934221.zip
changed the definition of dos_PutUniCode
the previous definition could result is us overflowing a buffer. The null termination was always added yet the size returned did not include the null termination. the new function takes a BOOL null_terminate, and always returns the total number of bytes consumed by the string.
Diffstat (limited to 'source/nmbd/nmbd_processlogon.c')
-rw-r--r--source/nmbd/nmbd_processlogon.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/source/nmbd/nmbd_processlogon.c b/source/nmbd/nmbd_processlogon.c
index bc4c6ea1271..0886654de9f 100644
--- a/source/nmbd/nmbd_processlogon.c
+++ b/source/nmbd/nmbd_processlogon.c
@@ -159,11 +159,8 @@ logons are not enabled.\n", inet_ntoa(p->ip) ));
{
q = align2(q, buf);
- dos_PutUniCode(q, my_name, sizeof(pstring)); /* PDC name */
- q = skip_unicode_string(q, 1);
-
- dos_PutUniCode(q, global_myworkgroup,sizeof(pstring)); /* Domain name*/
- q = skip_unicode_string(q, 1);
+ q += dos_PutUniCode(q, my_name, sizeof(pstring), True); /* PDC name */
+ q += dos_PutUniCode(q, global_myworkgroup,sizeof(pstring), True); /* Domain name*/
SIVAL(q, 0, ntversion);
SSVAL(q, 4, lmnttoken);
@@ -239,12 +236,10 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
}
q += 2;
- dos_PutUniCode(q, reply_name,sizeof(pstring));
- q = skip_unicode_string(q, 1);
+ q += dos_PutUniCode(q, reply_name,sizeof(pstring), True);
unistrcpy(q, uniuser);
q = skip_unicode_string(q, 1); /* User name (workstation trust account) */
- dos_PutUniCode(q, lp_workgroup(),sizeof(pstring));
- q = skip_unicode_string(q, 1); /* Domain name. */
+ q += dos_PutUniCode(q, lp_workgroup(),sizeof(pstring), True);
SIVAL(q, 0, ntversion);
q += 4;