mirror of
https://github.com/samba-team/samba.git
synced 2025-01-27 14:04:05 +03:00
r18: Fix free of incremented pointer
This commit is contained in:
parent
9598593bcf
commit
dfac69be4f
@ -116,13 +116,12 @@ static int open_cred_file(char * file_name)
|
|||||||
/* parse line from credential file */
|
/* parse line from credential file */
|
||||||
|
|
||||||
/* eat leading white space */
|
/* eat leading white space */
|
||||||
for(i=0;i<4096;i++) {
|
for(i=0;i<4086;i++) {
|
||||||
if((line_buf[i] != ' ') && (line_buf[i] != '\t'))
|
if((line_buf[i] != ' ') && (line_buf[i] != '\t'))
|
||||||
break;
|
break;
|
||||||
/* if whitespace - skip past it */
|
/* 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,'=');
|
temp_val = strchr(line_buf + i,'=');
|
||||||
if(temp_val) {
|
if(temp_val) {
|
||||||
/* go past equals sign */
|
/* go past equals sign */
|
||||||
@ -146,7 +145,7 @@ static int open_cred_file(char * file_name)
|
|||||||
strncpy(user_name,temp_val, length);
|
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,'=');
|
temp_val = strchr(line_buf+i,'=');
|
||||||
if(temp_val) {
|
if(temp_val) {
|
||||||
/* go past equals sign */
|
/* go past equals sign */
|
||||||
@ -376,7 +375,7 @@ static int parse_options(char * options, int * filesys_flags)
|
|||||||
if (value && *value) {
|
if (value && *value) {
|
||||||
rc = open_cred_file(value);
|
rc = open_cred_file(value);
|
||||||
if(rc) {
|
if(rc) {
|
||||||
printf("error %d opening credential file %s",rc, value);
|
printf("error %d opening credential file %s\n",rc, value);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user