Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: heap-buffer-overflow in run_length_encoding.c #1329

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vil02
Copy link
Member

@vil02 vil02 commented Oct 2, 2023

Description of Change

Running run_length_encoding.c leads to heap-buffer-overflow. The encoded is one too short. Moreover, there is an error in this test case:

assert(!strcmp(test, "1l1i1d1j1h1v1i1p1d1u1r1e1v1b1e1i1r1b1g1i1p1e1a1h1a1p1o1e1u1h1w1a1i1p1e1f1u1p1w1i1e1o1f1bq"));

Note that the last character of the output of the function run_length_encode has to be the same as the last character of the input.

This PR fixes the mentioned issues and adds new test cases.

References

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Relevant documentation/comments is changed or added
  • 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:

This PR fixes the heap-buffer-overflow in run_length_encoding.c.

@vil02 vil02 marked this pull request as ready for review October 2, 2023 15:13
Copy link
Contributor

github-actions bot commented Nov 2, 2023

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 Nov 2, 2023
@vil02
Copy link
Member Author

vil02 commented Nov 2, 2023

@Panquesito7, @tjgurwara99, @alexpantyukhin could some of you please add a dont-close or approved label?

@github-actions github-actions bot removed the Stale label Nov 3, 2023
@tjgurwara99 tjgurwara99 added the dont-close This issue/pull request shouldn't be closed label Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dont-close This issue/pull request shouldn't be closed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants