1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

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 4cb8cf221f)
This commit is contained in:
Volker Lendecke 2006-06-13 19:40:28 +00:00 committed by Gerald (Jerry) Carter
parent 92db75b4a2
commit a47ffac30d

View File

@ -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++;
}