Skip to content

Commit

Permalink
Merge pull request #667 from lastpass/append_http_prefix
Browse files Browse the repository at this point in the history
Append http prefix if missing
  • Loading branch information
TiborKLP authored Oct 17, 2023
2 parents 4d4facf + 97b0e53 commit 1cdf78c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions blob.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,16 @@ void account_set_note(struct account *account, char *note, unsigned const char k
}
void account_set_url(struct account *account, char *url, unsigned const char key[KDF_HASH_LEN])
{
if (url != NULL && strstr(url, "://") == NULL) {
char *url_with_prefix;
if ((url_with_prefix = malloc(strlen(url) + strlen("http://") + 1)) != NULL) {
strcpy(url_with_prefix, "http://");
strcat(url_with_prefix, url);
free(url);
url = url_with_prefix;
}
}

set_encrypted_field(account, url);
}
void account_set_appname(struct account *account, char *appname, unsigned const char key[KDF_HASH_LEN])
Expand Down

0 comments on commit 1cdf78c

Please sign in to comment.