You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The queue_peek() and queue_dequeue() functions did not check for
null before dereferencing the queue pointer, causing potential
undefined behavior. This patch adds explicit null checks in
queue.h to align its safety behavior with list.h.
Redundant checks in queue.c were removed, and queue_enqueue() was
updated to return an error when given a null pointer.
As part of this update, queue_count() now treats a null pointer
as an empty queue and returns 0, ensuring safe behavior even when
invalid pointers are passed.
0 commit comments