Copy the string into masterPassword because the line is getting free'd.
This commit is contained in:
parent
8006b7096f
commit
4876d62b56
@ -203,7 +203,7 @@ int main(int argc, char *const argv[]) {
|
||||
while ((linelen = getline(&line, &linecap, mpwConfig)) > 0) {
|
||||
char *lineData = line;
|
||||
if (strcmp(strsep(&lineData, ":"), userName) == 0) {
|
||||
masterPassword = strsep(&lineData, "\n");
|
||||
masterPassword = strcpy(malloc(strlen(lineData)), strsep(&lineData, "\n"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user