Skip to content

Check return value of vasprintf()

Sebastian Dröge requested to merge slomo/orc:vasprintf-return-value into main

With glibc, on allocation failure it doesn't set the pointer to NULL but instead conveniently leaves it undefined.

The BSD version is defined in a better way and sets the pointer to NULL to avoid further footguns.

Simply abort() on allocation failure. In the other code paths where malloc() is used, allocation failures are not checked like everywhere else in orc but it is assumed that dereferencing a NULL pointer simply crashes the process. Technically this is of course still undefined behaviour.

Merge request reports