Browse Source

adding onomem safeguard

doc_update_sequoia
Volker Birk 6 years ago
parent
commit
f6a473389c
2 changed files with 8 additions and 0 deletions
  1. +2
    -0
      src/keymanagement.c
  2. +6
    -0
      src/pEpEngine.c

+ 2
- 0
src/keymanagement.c View File

@ -752,6 +752,8 @@ DYNAMIC_API PEP_STATUS own_identities_retrieve(
sqlite3_column_int(session->own_key_is_listed, 4);
pEp_identity *ident = new_identity(address, fpr, user_id, username);
if (!ident)
goto enomem;
ident->comm_type = comm_type;
if (lang && lang[0]) {
ident->lang[0] = lang[0];


+ 6
- 0
src/pEpEngine.c View File

@ -979,6 +979,12 @@ DYNAMIC_API PEP_STATUS set_identity(
sqlite3_exec(session->db, "BEGIN ;", NULL, NULL, NULL);
if (identity->lang[0]) {
assert(identity->lang[0] >= 'a' && identity->lang[0] <= 'z');
assert(identity->lang[1] >= 'a' && identity->lang[1] <= 'z');
assert(identity->lang[2] == 0);
}
sqlite3_reset(session->set_person);
sqlite3_bind_text(session->set_person, 1, identity->user_id, -1,
SQLITE_STATIC);


Loading…
Cancel
Save