Who uses alloca in 2018, knowing how it's basically begging stack smashing?
Oh... systemd.
Conversation
Replying to
They have pervasive usage of alloca as a shortcut to work around their poor choice of tooling (C) for code that needs to do extensive string processing. Using alloca is even worse than VLAs since it's not block scoped but rather stays around for the whole life of the function.
1
1
They also make extensive and very questionable usage of other compiler extensions and strange idioms. They see what they're doing as using a very modern, clean dialect of C but they're using all kinds of hacks to reduce friction in very risky ways to work around the choice of C.
Take a look at some of their code and especially their libraries for basic non-domain-specific functionality (collections, string handling, etc.). They're definitely going to have more issues with alloca and some unique use-after-frees, etc. from their strange design choices.
1
1
Replying to
Excellently phrased, I feel systemd does this with everything. I was looking at their code to avoid deleting root with their custom deletion utility. Since they don't do path normalization (because it's dubiously too expensive and too much code), they have a hard-coded...
1
1
Show replies

