mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-02-13 13:54:36 +00:00
[BUG] Segmentation fault in queue.c
#158
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Arash1381-y on GitHub (Jun 10, 2023).
Description
In the queue model (path : data_structures/queue/queue.c). dequeue won't work due to a simple bug on the last if clause of it. take a look:
b1a8da69a8/data_structures/queue/queue.c (L65)as you can see if we have only one variable in our queue on dequeue the HEAD will be null and assigning NULL to NULL->next will cause a segmentation fault.
Expected behavior
not to cause fault =)
Actual behavior
case segmentation fault
Possible fix
simply put line 65 in its above clause
Steps to reproduce
Context
It just don't work =)
Additional information
No response
@github-actions[bot] commented on GitHub (Jul 12, 2023):
This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@github-actions[bot] commented on GitHub (Jul 19, 2023):
Please ping one of the maintainers once you add more information and updates here. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!