Skip to content

Commit

Permalink
Skip null attribute during DB update
Browse files Browse the repository at this point in the history
  • Loading branch information
tracefinder committed Nov 7, 2023
1 parent 1b3aab9 commit 0076e5a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lib/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -2169,9 +2169,11 @@ static CK_RV dbup_handler_from_7_to_8(sqlite3 *updb) {

/* for each tobject */
CK_ATTRIBUTE_PTR a = attr_get_attribute_by_type(tobj->attrs, CKA_ALLOWED_MECHANISMS);
CK_BYTE type = type_from_ptr(a->pValue, a->ulValueLen);
if (type != TYPE_BYTE_INT_SEQ) {
rv = _db_update_tobject_attrs(updb, tobj->id, tobj->attrs);
if (a) {
CK_BYTE type = type_from_ptr(a->pValue, a->ulValueLen);
if (type != TYPE_BYTE_INT_SEQ) {
rv = _db_update_tobject_attrs(updb, tobj->id, tobj->attrs);
}
}

tobject_free(tobj);
Expand Down

0 comments on commit 0076e5a

Please sign in to comment.