alloca: add an overflow check too
authorLennart Poettering <lennart@poettering.net>
Fri, 27 Apr 2018 12:27:14 +0000 (14:27 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 27 Apr 2018 12:29:06 +0000 (14:29 +0200)
commit1232c44718b04024d1cccecb5c0ae75c311eaea3
tree2defed79656019d32298192e8a291b3dd7d7ee1d
parentda6053d0a7c16795e7fac1f9ba6694863918a597
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