Skip to content

Fix: Deque accessors and display function null pointer dereference (#871)#874

Merged
darshan2456 merged 3 commits into
darshan2456:mainfrom
Akshatshukla-25:feature/fix-deque-null-dereference-bug3
Jul 17, 2026
Merged

Fix: Deque accessors and display function null pointer dereference (#871)#874
darshan2456 merged 3 commits into
darshan2456:mainfrom
Akshatshukla-25:feature/fix-deque-null-dereference-bug3

Conversation

@Akshatshukla-25

Copy link
Copy Markdown
Contributor

Description

This PR addresses Bug 3 of issue #871. It adds explicit NULL pointer checks for stored elements inside the deque accessors (deque_get_front and deque_get_rear) and the output formatter (display_deque) in src/data_structures/deque.c to prevent crashes when NULL values are stored in the queue.

Resolves

Changes

  • deque.c: Added dq->arr[...] == NULL checks in deque_get_front, deque_get_rear, and display_deque.
  • Makefile: Linked missing help objects to resolve test suite build errors (carried over to this branch).

Verification & Testing

  • Ran make fmt to format all code.
  • Successfully compiled using make.
  • Passed all unit tests using make test.

@darshan2456
darshan2456 merged commit 2ef2a64 into darshan2456:main Jul 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants