svn commit: samba r16203 - branches/SAMBA_3_0/source/smbd
trunk/source/smbd
vlendec at samba.org
vlendec at samba.org
Tue Jun 13 19:40:28 GMT 2006
Author: vlendec
Date: 2006-06-13 19:40:28 +0000 (Tue, 13 Jun 2006)
New Revision: 16203
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16203
Log:
Fix potentially writing one result of strtok beyond the end of alt_path.
Found by Klocwork, ID 653.
Volker
Modified:
branches/SAMBA_3_0/source/smbd/msdfs.c
trunk/source/smbd/msdfs.c
Changeset:
Modified: branches/SAMBA_3_0/source/smbd/msdfs.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/msdfs.c 2006-06-13 18:15:03 UTC (rev 16202)
+++ branches/SAMBA_3_0/source/smbd/msdfs.c 2006-06-13 19:40:28 UTC (rev 16203)
@@ -203,7 +203,8 @@
}
/* parse out the alternate paths */
- while(((alt_path[count] = strtok(NULL,",")) != NULL) && count<MAX_REFERRAL_COUNT) {
+ while((count<MAX_REFERRAL_COUNT) &&
+ ((alt_path[count] = strtok(NULL,",")) != NULL)) {
count++;
}
Modified: trunk/source/smbd/msdfs.c
===================================================================
--- trunk/source/smbd/msdfs.c 2006-06-13 18:15:03 UTC (rev 16202)
+++ trunk/source/smbd/msdfs.c 2006-06-13 19:40:28 UTC (rev 16203)
@@ -203,7 +203,8 @@
}
/* parse out the alternate paths */
- while(((alt_path[count] = strtok(NULL,",")) != NULL) && count<MAX_REFERRAL_COUNT) {
+ while((count<MAX_REFERRAL_COUNT) &&
+ ((alt_path[count] = strtok(NULL,",")) != NULL)) {
count++;
}
More information about the samba-cvs
mailing list