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 split() pivoting to avoid stack overflow from Quicksort worst case. #12

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

Conversation

samuelhuang
Copy link

One such case is 'A' * 1048575 + 'B' + 'A' * 1048575 + 'C'. Demo:
gcc -DBSDIFF_EXECUTABLE bsdiff.c -lbz2 -o bsdiff
perl -e "print('A'x1048575,'B','A'x1048575,'C')" > big
./bsdiff big big patch

Output before patch: 'Segmentation fault (core dumped)'.
Output after patch: No crash, outputs 85 byte file 'patch'.

Details: http://crbug.com/605565#c11

…flow.

One such case is 'A' * 1048575 + 'B' + 'A' * 1048575 + 'C'. Demo:
  gcc -DBSDIFF_EXECUTABLE bsdiff.c -lbz2 -o bsdiff
  perl -e "print('A'x1048575,'B','A'x1048575,'C')" > big
  ./bsdiff big big patch

Output before patch: 'Segmentation fault (core dumped)'.
Output after patch: No crash, outputs 85 byte file 'patch'.

Details: http://crbug.com/605565#c11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant