* Handle the cpu context save in a more pythonic way, so the context can be serialized and reuse in an other process using the same emulator architecture and modes * Fix type error ; mistakes a size_t uint64_t ; breaks in 32bit... * Fix the UAF situation when deleting a hook while being in a hook callback. Added an attribute 'to_delete' to hooks, and a list hooks_to_del to delay the free of the hooks * Minor fixes ; forgot return type of clear_deleted_hooks ; do not declare variable in for predicate
This commit is contained in:
19
list.c
19
list.c
@ -90,3 +90,22 @@ bool list_remove(struct list *list, void *data)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// returns true if the data exists in the list
|
||||
bool list_exists(struct list *list, void *data)
|
||||
{
|
||||
struct list_item *next, *cur = NULL;
|
||||
// is list empty?
|
||||
if (list->head == NULL) {
|
||||
return false;
|
||||
}
|
||||
cur = list->head;
|
||||
while (cur != NULL) {
|
||||
next = cur->next;
|
||||
if (cur->data == data) {
|
||||
return true;
|
||||
}
|
||||
cur = next;
|
||||
}
|
||||
return false;
|
||||
}
|
Reference in New Issue
Block a user