Skip to content

Conversation

Artursrossi
Copy link

Description of Change

  • Prevent segmentation fault error at stack.c grow function
    • After malloc, there is an iteration without any check if malloc returned null

References

Checklist

  • Added description of change
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes: Used realloc instead of malloc

Copy link
Member

@vil02 vil02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In principle this is a change in a very good direction: standard functions are always better than manual work.

Copy link
Author

@Artursrossi Artursrossi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used assert() function just to maintain the file code standard. In other functions like initStack(), push() and pop(), the original author chose to use assert().

Copy link
Contributor

This pull request 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 github-actions bot added the Stale label Apr 26, 2025
Copy link
Contributor

github-actions bot commented May 3, 2025

Please ping one of the maintainers once you commit the changes requested or make improvements on the code. 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!

@github-actions github-actions bot closed this May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants