Skip to content

nl: fix oversized stack allocation with NL_TEXTMAX under glibc#44

Open
Nembles1000 wants to merge 1 commit into
chimera-linux:masterfrom
Nembles1000:master
Open

nl: fix oversized stack allocation with NL_TEXTMAX under glibc#44
Nembles1000 wants to merge 1 commit into
chimera-linux:masterfrom
Nembles1000:master

Conversation

@Nembles1000
Copy link
Copy Markdown

nl.c declares this stack buffer to hold regex errors.

 char errorbuf[NL_TEXTMAX]; 

glibc defines it as INT_MAX, so it tries to allocate 2gb. On BSD systems this number is 255.
Setting it as 256 matches bsd and is enough for any regex message.

 char errorbuf[256];

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