chiark / gitweb /
alloca: add an overflow check too
authorLennart Poettering <lennart@poettering.net>
Fri, 27 Apr 2018 12:27:14 +0000 (14:27 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
commit7ebe63f00f55a754c07c020c80fbbba799c30fda
tree4576674cc035102805a7dba4dede23bc87d4038f
parent94062cd7c9680c5e9870f4352fcd5f0db2e51dfd
alloca: add an overflow check too

Of course, alloca() shouldn't be used with anything that can grow
without bounds anyway, but let's better safe than sorry, and catch this
early.

Since alloca() is not supposed to return an error we trigger an
assert() instead, which is still better than heap trickery.
src/basic/alloc-util.h