]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix bug #5434 found by Ted Percival <ted@midg3t.net>.
authorJeremy Allison <jra@samba.org>
Thu, 1 May 2008 15:40:30 +0000 (08:40 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 1 May 2008 15:40:30 +0000 (08:40 -0700)
Introduced by me in the strlcpy cleanup. Ensure the
loaded password doesn't contain the '\n' at the end.
Karolin - please pull for 3.2 stable !
Jeremy.

source/client/mount.cifs.c

index 96ab4a8910e4f7521b264e13b13aa1bd79b4b302..d1b735525e9534826777cc3d821a88ddf1cb97b7 100644 (file)
@@ -236,6 +236,7 @@ static int open_cred_file(char * file_name)
                                for(length = 0;length<MOUNT_PASSWD_SIZE+1;length++) {
                                        if ((temp_val[length] == '\n')
                                            || (temp_val[length] == '\0')) {
+                                               temp_val[length] = '\0';
                                                break;
                                        }
                                }
@@ -264,6 +265,7 @@ static int open_cred_file(char * file_name)
                                 for(length = 0;length<DOMAIN_SIZE+1;length++) {
                                        if ((temp_val[length] == '\n')
                                            || (temp_val[length] == '\0')) {
+                                               temp_val[length] = '\0';
                                                break;
                                        }
                                 }