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

Heap buffer overflow from the fix to issue 83 #121

Closed
m-lw opened this issue Jul 8, 2021 · 1 comment
Closed

Heap buffer overflow from the fix to issue 83 #121

m-lw opened this issue Jul 8, 2021 · 1 comment

Comments

@m-lw
Copy link

m-lw commented Jul 8, 2021

The fix for #83 changed the code to insert 2 chars, but the call to adjbuf just above it only allows for 1 char. This can cause a heap buffer overflow.

E.g. in git master on CentOS 6.10:
$ echo \\ | env LANG=C MALLOC_CHECK_=1 ./a.out '/[[:cntrl:]01234567[:graph:]]/' *** glibc detected *** a.out: realloc(): invalid pointer: 0x00000000008c5be0 *** \ $

@plan9
Copy link
Collaborator

plan9 commented Jul 8, 2021

interesting, thank you for spotting.

awkfan77 added a commit to awkfan77/fawk that referenced this issue Oct 9, 2021
plan9 added a commit that referenced this issue Oct 12, 2021
@plan9 plan9 closed this as completed in 40f0527 Oct 12, 2021
mbissaromoto pushed a commit to MotorolaMobilityLLC/external-one-true-awk that referenced this issue Jun 23, 2023
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

No branches or pull requests

2 participants