summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-06-13 19:40:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:25 -0500
commita47ffac30d3363a93182584859ab273cfc3de2d3 (patch)
tree5789f4e43ea920054949725c880f0627a0e0bead
parent92db75b4a25823cf6882681267418a71d3cdb8c9 (diff)
downloadsamba-a47ffac30d3363a93182584859ab273cfc3de2d3.tar.gz
samba-a47ffac30d3363a93182584859ab273cfc3de2d3.tar.bz2
samba-a47ffac30d3363a93182584859ab273cfc3de2d3.zip
r16203: Fix potentially writing one result of strtok beyond the end of alt_path.
Found by Klocwork, ID 653. Volker (This used to be commit 4cb8cf221f986b15de3ac608b173310c14248533)
-rw-r--r--source3/smbd/msdfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index 700aa2ae81..55a6850478 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -203,7 +203,8 @@ static BOOL parse_symlink(TALLOC_CTX *ctx, char *buf, struct referral **preflist
}
/* 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++;
}