summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorSteve French <sfrench@samba.org>2004-04-04 15:20:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:51:03 -0500
commitdfac69be4fc63745e2d0b4cecb8106286c7c8ca0 (patch)
tree1122b14f8e0f3230826b9e53c1c71d05f940090c /source
parent9598593bcf2d877b1d08cd6a7323ee0bc160d4ba (diff)
downloadsamba-dfac69be4fc63745e2d0b4cecb8106286c7c8ca0.tar.gz
samba-dfac69be4fc63745e2d0b4cecb8106286c7c8ca0.tar.xz
samba-dfac69be4fc63745e2d0b4cecb8106286c7c8ca0.zip
r18: Fix free of incremented pointer
Diffstat (limited to 'source')
-rwxr-xr-xsource/client/mount.cifs.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/client/mount.cifs.c b/source/client/mount.cifs.c
index a2f9ebf45ca..c31a9d66b34 100755
--- a/source/client/mount.cifs.c
+++ b/source/client/mount.cifs.c
@@ -116,13 +116,12 @@ static int open_cred_file(char * file_name)
/* parse line from credential file */
/* eat leading white space */
- for(i=0;i<4096;i++) {
+ for(i=0;i<4086;i++) {
if((line_buf[i] != ' ') && (line_buf[i] != '\t'))
break;
/* if whitespace - skip past it */
- line_buf++;
}
- if (strncasecmp("username",line_buf,8) == 0) {
+ if (strncasecmp("username",line_buf+i,8) == 0) {
temp_val = strchr(line_buf + i,'=');
if(temp_val) {
/* go past equals sign */
@@ -146,7 +145,7 @@ static int open_cred_file(char * file_name)
strncpy(user_name,temp_val, length);
}
}
- } else if (strncasecmp("password",line_buf,8) == 0) {
+ } else if (strncasecmp("password",line_buf+i,8) == 0) {
temp_val = strchr(line_buf+i,'=');
if(temp_val) {
/* go past equals sign */
@@ -376,7 +375,7 @@ static int parse_options(char * options, int * filesys_flags)
if (value && *value) {
rc = open_cred_file(value);
if(rc) {
- printf("error %d opening credential file %s",rc, value);
+ printf("error %d opening credential file %s\n",rc, value);
return 1;
}
} else {