summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-03-14 17:21:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:27 -0500
commite6676a9a6928deb03c2a43a66c1245dd05d03e71 (patch)
tree25f31eac683ccd1082cae2dd37dc9d511000fa67 /source3/smbd
parentbe738dd31dace66f53558b64d6f67828204650aa (diff)
downloadsamba-e6676a9a6928deb03c2a43a66c1245dd05d03e71.tar.gz
samba-e6676a9a6928deb03c2a43a66c1245dd05d03e71.tar.bz2
samba-e6676a9a6928deb03c2a43a66c1245dd05d03e71.zip
r14387: Try and fix the coverity issues (#53, #54) with negative
sink by ensuring all uses of rpcstr_push are consistent with a size_t dest size arg. Jeremy. (This used to be commit f65d7afe1977d9d85046732842f9643716c15088)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/msdfs.c8
-rw-r--r--source3/smbd/trans2.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index 257a6105c5..4606441c3a 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -609,7 +609,7 @@ static int setup_ver2_dfs_referral(char *pathname, char **ppdata,
DEBUG(10,("setting up version2 referral\nRequested path:\n"));
- requestedpathlen = rpcstr_push(uni_requestedpath, pathname, -1,
+ requestedpathlen = rpcstr_push(uni_requestedpath, pathname, sizeof(pstring),
STR_TERMINATE);
if (DEBUGLVL(10)) {
@@ -680,7 +680,7 @@ static int setup_ver2_dfs_referral(char *pathname, char **ppdata,
SSVAL(pdata,offset+18,uni_reqpathoffset2-offset);
/* copy referred path into current offset */
unilen = rpcstr_push(pdata+uni_curroffset, ref->alternate_path,
- (size_t)-1, STR_UNICODE);
+ sizeof(pstring), STR_UNICODE);
SSVAL(pdata,offset+20,uni_curroffset-offset);
@@ -709,7 +709,7 @@ static int setup_ver3_dfs_referral(char *pathname, char **ppdata,
DEBUG(10,("setting up version3 referral\n"));
- reqpathlen = rpcstr_push(uni_reqpath, pathname, (size_t)-1, STR_TERMINATE);
+ reqpathlen = rpcstr_push(uni_reqpath, pathname, sizeof(pstring), STR_TERMINATE);
if (DEBUGLVL(10)) {
dump_data(0, (char *) uni_reqpath,reqpathlen);
@@ -764,7 +764,7 @@ static int setup_ver3_dfs_referral(char *pathname, char **ppdata,
SSVAL(pdata,offset+14,uni_reqpathoffset2-offset);
/* copy referred path into current offset */
unilen = rpcstr_push(pdata+uni_curroffset,ref->alternate_path,
- -1, STR_UNICODE | STR_TERMINATE);
+ sizeof(pstring), STR_UNICODE | STR_TERMINATE);
SSVAL(pdata,offset+16,uni_curroffset-offset);
/* copy 0x10 bytes of 00's in the ServiceSite GUID */
memset(pdata+offset+18,'\0',16);
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 9cd2d44de5..8429cd7149 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -3221,7 +3221,7 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
/* Pathname with leading '\'. */
{
size_t byte_len;
- byte_len = dos_PutUniCode(pdata+4,dos_fname,max_data_bytes,False);
+ byte_len = dos_PutUniCode(pdata+4,dos_fname,(size_t)max_data_bytes,False);
DEBUG(10,("call_trans2qfilepathinfo: SMB_FILE_NAME_INFORMATION\n"));
SIVAL(pdata,0,byte_len);
data_size = 4 + byte_len;
@@ -3265,7 +3265,7 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
if (mode & aDIR) {
data_size = 0;
} else {
- size_t byte_len = dos_PutUniCode(pdata+24,"::$DATA", 0xE, False);
+ size_t byte_len = dos_PutUniCode(pdata+24,"::$DATA", (size_t)0xE, False);
SIVAL(pdata,0,0); /* ??? */
SIVAL(pdata,4,byte_len); /* Byte length of unicode string ::$DATA */
SOFF_T(pdata,8,file_size);