From e422b9f856435818b0c3c1b7e152f193493a739c Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 2 Sep 2008 22:21:34 +0000 Subject: [PATCH] DEVEL15-smb-string-conversion-20080902 LICENSE MIT more cases where -1 should be passed in as opposed to the strlen value when converting between char and wchar forms (cherry picked from commit 84e10d582abdf65a5354b1c4b41d7e2ecad532f8) --- src/WINNT/afsd/smb.c | 2 +- src/WINNT/afsd/smb_ioctl.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/WINNT/afsd/smb.c b/src/WINNT/afsd/smb.c index 5fab856730..3263515bbc 100644 --- a/src/WINNT/afsd/smb.c +++ b/src/WINNT/afsd/smb.c @@ -1996,7 +1996,7 @@ int smb_FindShare(smb_vc_t *vcp, smb_user_t *uidp, if (code == 0) { clientchar_t temp[1024]; - cm_FsStringToClientString(ftemp, (int)cm_FsStrLen(ftemp), temp, 1024); + cm_FsStringToClientString(ftemp, -1, temp, 1024); cm_ClientStrPrintfN(pathName, (int)lengthof(pathName), rw ? _C("/.%S/") : _C("/%S/"), temp); *pathNamep = cm_ClientStrDup(cm_ClientStrLwr(pathName)); diff --git a/src/WINNT/afsd/smb_ioctl.c b/src/WINNT/afsd/smb_ioctl.c index adc463a525..d15585efc3 100644 --- a/src/WINNT/afsd/smb_ioctl.c +++ b/src/WINNT/afsd/smb_ioctl.c @@ -1064,8 +1064,7 @@ smb_IoctlGetSMBName(smb_ioctl_t *ioctlp, cm_user_t *userp) int cch; cch = cm_ClientStringToUtf8(uidp->unp->name, - cm_ClientStrLen(uidp->unp->name), - + -1, ioctlp->ioctl.outDatap, (SMB_IOCTL_MAXDATA - (ioctlp->ioctl.outDatap - ioctlp->ioctl.outAllocp))