summaryrefslogtreecommitdiff
path: root/source3/smbd/trans2.c
diff options
context:
space:
mode:
authorMatthew Chapman <matty@samba.org>1999-02-15 05:33:30 +0000
committerMatthew Chapman <matty@samba.org>1999-02-15 05:33:30 +0000
commit2737f26ad64ee32d6ef7365dcce0a3eb881f99db (patch)
tree52dce623844dbea155cb961ad50f1edf83d8a1df /source3/smbd/trans2.c
parent0baa42bdd751b81ca6d17d1b5377a4e345936cad (diff)
downloadsamba-2737f26ad64ee32d6ef7365dcce0a3eb881f99db.tar.gz
samba-2737f26ad64ee32d6ef7365dcce0a3eb881f99db.tar.bz2
samba-2737f26ad64ee32d6ef7365dcce0a3eb881f99db.zip
Always null-terminate strings.
Also some string length and sizeof(pointer) corrections. (This used to be commit ce24191939b82985d09eabe945199f38b0fea486)
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r--source3/smbd/trans2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 1bfcaa5f12..f041393dab 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1121,7 +1121,7 @@ static int call_trans2qfsinfo(connection_struct *conn,
#endif /* Old code. */
SIVAL(pdata,4,128); /* Max filename component length */
SIVAL(pdata,8,2*strlen(fstype));
- ascii_to_unibuf(pdata+12, fstype, 1024-12);
+ ascii_to_unibuf(pdata+12, fstype, 1024-2-12);
SSVAL(outbuf,smb_flg2,SVAL(outbuf,smb_flg2)|FLAGS2_UNICODE_STRINGS);
break;
case SMB_QUERY_FS_LABEL_INFO:
@@ -1148,7 +1148,7 @@ static int call_trans2qfsinfo(connection_struct *conn,
} else {
data_len = 18 + 2*strlen(vname);
SIVAL(pdata,12,strlen(vname)*2);
- ascii_to_unibuf(pdata+18, vname, 1024-18);
+ ascii_to_unibuf(pdata+18, vname, 1024-2-18);
}
DEBUG(5,("call_trans2qfsinfo : SMB_QUERY_FS_VOLUME_INFO namelen = %d, vol = %s\n",
@@ -1405,7 +1405,7 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
*short_name = '\0';
}
strupper(short_name);
- data_end = ascii_to_unibuf(pdata + 4, short_name, 1024-4);
+ data_end = ascii_to_unibuf(pdata + 4, short_name, 1024-2-4);
data_size = data_end - pdata;
SIVAL(pdata,0,2*(data_size-4));
}