Commit Graph

5 Commits

Author SHA1 Message Date
Daniel Hirt 93397449d4 Eina binbuf: add explicit null-check before magic-check
Summary:
Using `--disable-magic-debug` defines EINA_MAGIC_CHECK to always
evaluate to `1`. Eina_Binbuf's null-check relied solely on the
EINA_MAGIC_CHECK, and failed to pick up on the cases where `buf` was
passed as NULL. This has led to  a segfault when a NULL `buf` was passed
in the test suite (see referenced ticket).

This fix adds an explicit NULL check.

Fixes https://phab.enlightenment.org/T7147

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6592
2018-07-16 06:09:38 -04:00
Gustavo Sverzut Barbieri 09825cbe5d eina_binbuf: allow expand & usage of extra bytes.
Some code needs to read directly into eina_binbuf to avoid an extra
copy from eina_binbuf_append* variants.

This can be achieved by using eina_binbuf_expand(), which returns a
write-able slice of the spare bytes. Once they are used,
eina_binbuf_use() should be called to increment "buf->len", which is
used by all other binbuf functions such as eina_binbuf_length_get() or
eina_binbuf_append_slice().
2016-12-20 10:18:32 -02:00
Gustavo Sverzut Barbieri 0d96ba9734 binbuf, strbuf and ustrbuf: add slice_get() and rw_slice_get(). 2016-08-22 18:25:14 -03:00
Cedric BAIL 55a56fe5c0 eina: add eina_{str,bin}buf_manage_read_only_new_length().
It is sometime useful to start from a defined buffer, but to not touch it
until needed. This make life of caller more easier as they don't need to
duplicate the buffer themself as Eina will now take care of that.
2014-01-20 13:04:07 +09:00
Vincent Torri 785f2a6b3a merge : add eina
currently, examples, tests and benchmark are not set. That's the next things i'll do


SVN revision: 76710
2012-09-16 10:57:48 +00:00