diff options
-rw-r--r-- | source3/client/mount.cifs.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/client/mount.cifs.c b/source3/client/mount.cifs.c index 44614f6e8a..c68c9ee7f7 100644 --- a/source3/client/mount.cifs.c +++ b/source3/client/mount.cifs.c @@ -205,8 +205,10 @@ static int open_cred_file(char * file_name) /* go past equals sign */ temp_val++; for(length = 0;length<4087;length++) { - if(temp_val[length] == '\n') + if ((temp_val[length] == '\n') + || (temp_val[length] == '\0')) { break; + } } if(length > 4086) { printf("mount.cifs failed due to malformed username in credentials file"); @@ -229,7 +231,7 @@ static int open_cred_file(char * file_name) /* go past equals sign */ temp_val++; for(length = 0;length<65;length++) { - if(temp_val[length] == '\n') + if(temp_val[length] == '\n' || temp_val[length] == '\0') break; } if(length > 64) { @@ -258,7 +260,7 @@ static int open_cred_file(char * file_name) if(verboseflag) printf("\nDomain %s\n",temp_val); for(length = 0;length<65;length++) { - if(temp_val[length] == '\n') + if(temp_val[length] == '\n' || temp_val[length] == '\0') break; } if(length > 64) { |