SGX_SQLite
SGX_SQLite copied to clipboard
[Security] Use after free in enclave
ecall_closedb() must set db pointer to NULL after free the object.
void ecall_closedb(){
sqlite3_close(db);
db = NULL; // change
ocall_println_string("Enclave: Closed database connection");
}
Otherwise a check like:
if (db == 0){
return ERR;
}
magic = db->magic_byte;
will fail from multiple places.