summaryrefslogtreecommitdiff
path: root/mount.cifs.c
diff options
context:
space:
mode:
Diffstat (limited to 'mount.cifs.c')
-rw-r--r--mount.cifs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mount.cifs.c b/mount.cifs.c
index c4eb59a..127e6db 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -761,7 +761,11 @@ parse_options(const char *data, struct parsed_mount_info *parsed_info)
return EX_USAGE;
}
} else {
- if (strnlen(value, 260) >= 260) {
+ /* domain/username%password */
+ const int max = MAX_DOMAIN_SIZE +
+ MAX_USERNAME_SIZE +
+ MOUNT_PASSWD_SIZE + 2;
+ if (strnlen(value, max + 1) >= max + 1) {
fprintf(stderr, "username too long\n");
return EX_USAGE;
}