4d0200e2055cd5507409b4ee998534e5a1479b1c |
|
24-Nov-2017 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
lib: buffer - Add t_buffer_create
Helper for making a datastack buffer |
a44866b012a59906a592a8847ca43230c020fe2b |
|
24-Nov-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Clarify that buffer_write() zero-fills buffer when writing past its size |
e07b8f034b4c214e94aa5eb93d96ccbe60094b4b |
|
02-Nov-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
lib: Add buffer truncate |
23bdbb7b1831785c6ba6df190f6369da882d2b9d |
|
06-Jun-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: Require comparisons to be strict boolean expressions
* No implicit integer -> boolean or pointer -> boolean conversions
* !expr can be used only if expr is boolean type
These were checked with a patched clang. It found various actual bugs,
which were fixed by the previous commits. |
f6d5c9fbdac9af5c4d3f467f828dc6f056309d5e |
|
18-May-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
Removed buffer_reset().
It was just a wrapper to buffer_set_used_size() and its comment was a bit
confusing (or obsolete), since it wasn't actually immediately zeroing out
the buffer. |
94a6b3df81d2edb93460b7beca6d37e618a48262 |
|
18-May-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Updated buffer_set_used_size() comment and added unit test. |
f67a12c7a2dd33b69b303a7cab85c7ed82ba4d85 |
|
24-Sep-2015 |
Timo Sirainen <tss@iki.fi> |
lib: Fixed __builtin_object_size() usage in buffer.h
With type=3 size for unknown objects is set to 0, which causes a compiler
failure. With type=1 it's (size_t)-1, which passes the check. |
e915ba86f157549b7d127f92312bc487b249df7e |
|
16-May-2015 |
Timo Sirainen <tss@iki.fi> |
lib: Added buffer_get_writable_size() |
0a568c1e8a8066ce9d6467d891a9717bd2a24b26 |
|
28-Jul-2014 |
Phil Carmody <phil@dovecot.fi> |
lib: compile time checks for buffer creation
Ensure the data buffer has as much space as the size parameter claims.
This uses the strictest test GCC provides - the smallest containing object,
and returning 0 for unknown size.
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
a94f166ade968e8127b3eeda729417db9c6ad52f |
|
04-Jan-2013 |
Timo Sirainen <tss@iki.fi> |
Added buffer_verify_pool() |
3281669db44d09a087a203201248abbc81b3cc1a |
|
06-Sep-2012 |
Timo Sirainen <tss@iki.fi> |
Renamed buffer_create_*data() to buffer_create_from_*data() for consistency.
Especially i_stream_create_from_data() was a very similar function, which
made it difficult to remember which one should have "from" and which one
shouldn't. |
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4 |
|
23-Jun-2012 |
Timo Sirainen <tss@iki.fi> |
Marked functions parameters that are allowed to be NULL. Some APIs were also changed.
The non-obvious APIs where NULL parameter was changed to "" are
master_service_init() and auth_master_user_list_init().
These checks can currently be enabled only on a patched clang:
http://llvm.org/bugs/show_bug.cgi?id=6786 |
02752bc8d64df8cd361f464e55422f7b3f2f143e |
|
25-Nov-2009 |
Timo Sirainen <tss@iki.fi> |
Removed buffer_create_static_hard().
buffer_create_data() handles most of the situations where it was wanted.
--HG--
branch : HEAD |
8e361d2906b0e44f7175a20981f8d2280645b58b |
|
14-Jul-2009 |
Timo Sirainen <tss@iki.fi> |
buffer_create_[const_]data() API change: Take buffer_t as parameter instead of allocating it.
--HG--
branch : HEAD |
68a4946b12583b88fa802e52ebee45cd96056772 |
|
20-Jun-2008 |
Timo Sirainen <tss@iki.fi> |
Added more consts, ATTR_CONSTs and ATTR_PUREs.
--HG--
branch : HEAD |
0f66f12eb4cdbf47670975044c88d8f388bf92df |
|
15-Sep-2007 |
Timo Sirainen <tss@iki.fi> |
Changed buffer_free() and buffer_free_without_data() APIs to take ** pointer
which is set to NULL instead of hiding it with a macro.
--HG--
branch : HEAD |
c25356d5978632df6203437e1953bcb29e0c736f |
|
16-Sep-2007 |
Timo Sirainen <tss@iki.fi> |
Changed .h ifdef/defines to use <NAME>_H format.
--HG--
branch : HEAD |
1345157bfafcc329b237e55a35db8c2ad368a42a |
|
11-Jun-2007 |
Timo Sirainen <tss@iki.fi> |
Added buffer_get_pool()
--HG--
branch : HEAD |
8d80659e504ffb34bb0c6a633184fece35751b18 |
|
28-Jun-2006 |
Timo Sirainen <tss@iki.fi> |
Array API redesigned to work using unions. It now provides type safety
without having to enable DEBUG, as long as the compiler supports typeof().
Its API changed a bit. It now allows directly accessing the array contents,
although that's not necessarily recommended. Changed existing array usage to
be type safe in a bit more places. Removed array_t completely. Also did
s/modifyable/modifiable/.
--HG--
branch : HEAD |
d5cebe7f98e63d4e2822863ef2faa4971e8b3a5d |
|
14-Jan-2006 |
Timo Sirainen <tss@iki.fi> |
deinit, unref, destroy, close, free, etc. functions now take a pointer to
their data pointer, and set it to NULL. This makes double-frees less likely
to cause security holes.
--HG--
branch : HEAD |
6ef7e31619edfaa17ed044b45861d106a86191ef |
|
13-Jan-2006 |
Timo Sirainen <tss@iki.fi> |
Added "bool" type and changed all ints that were used as booleans to bool.
--HG--
branch : HEAD |
bdf7a0f43f555483fe6ef47fcaab4f196f3b67b4 |
|
30-Jun-2005 |
Timo Sirainen <tss@iki.fi> |
Added buffer_update_const_data().
--HG--
branch : HEAD |
1f48195853496af8581227f3168d80c6b83c07c5 |
|
16-Apr-2005 |
Timo Sirainen <tss@iki.fi> |
Added BUFFER_APPROX_SIZE which can be used to approximately calculate the
memory used by buffer struct itself.
--HG--
branch : HEAD |
02af13e6a41b9c3e6ad1e0b692b5b9741142c221 |
|
02-Apr-2005 |
Timo Sirainen <tss@iki.fi> |
Added buffer_cmp().
--HG--
branch : HEAD |
bbe0ee356dc610a8d054b336534d8f33c49a36b7 |
|
12-Mar-2005 |
Timo Sirainen <tss@iki.fi> |
Minor cleanup: added _r suffix to used_size pointer parameters.
--HG--
branch : HEAD |
4b058f90f9e8a2c6b2eed275de4eb8cc5195a71d |
|
08-Oct-2004 |
Timo Sirainen <tss@iki.fi> |
Buffer API change: we no longer support limited sized buffers where
writes past limit wouldn't kill the process. They weren't used hardly
anywhere, they could have hidden bugs and the code for handling them was too
complex.
This also changed base64 and hex-binary APIs.
--HG--
branch : HEAD |
a05b31e6bb304142baf496e80072aa524e2dae3e |
|
03-Oct-2004 |
Timo Sirainen <tss@iki.fi> |
Added buffer_insert_zero()
--HG--
branch : HEAD |
0138d3060877805f0de0bf631642de100ff96b79 |
|
12-Sep-2004 |
Timo Sirainen <tss@iki.fi> |
Added buffer_write_zero and buffer_append_zero.
--HG--
branch : HEAD |
40f114f2e12605483b21e7cf048b7c9bd9568148 |
|
18-Aug-2004 |
Timo Sirainen <tss@iki.fi> |
Added buffer_reset()
--HG--
branch : HEAD |
aef3780a1dc2f85ab172fa9cf61294e1856e51b3 |
|
01-Aug-2004 |
Timo Sirainen <tss@iki.fi> |
buffer.data should be void, not unsigned char
--HG--
branch : HEAD |
b561170c84d19ef1dee3d528939d77fd38047b3f |
|
31-Jul-2004 |
Timo Sirainen <tss@iki.fi> |
Removed start_pos and limit handling, they weren't used much and were only
making it more complex. Also made data and size variables directly
accessible to make it easier to use buffers.
--HG--
branch : HEAD |
a29a5b7520f7b8d6cdaf97e66d184b6a9e4f4ecf |
|
26-Oct-2003 |
Timo Sirainen <tss@iki.fi> |
Use unsigned char for buffer_append_c and str_append_c.
--HG--
branch : HEAD |
38499bb33c74acc6d725204e893cfc02a5890ec7 |
|
15-May-2003 |
Timo Sirainen <tss@iki.fi> |
Renamed buffer_*_space() to buffer_*_space_unsafe() and added several
warnings about using them. Fixed their usage in a few places in sources
where they could have produced invalid results (no buffer overflows,
luckily).
--HG--
branch : HEAD |
c0435c854a0e7246373b9752d163095cc4fbe985 |
|
05-Jan-2003 |
Timo Sirainen <tss@iki.fi> |
Naming style changes, finally got tired of most of the typedefs. Also the
previous enum -> macro change reverted so that we don't use the highest bit
anymore, that's incompatible with old indexes so they will be rebuilt.
--HG--
branch : HEAD |
5254d77805cd35b9356d072ba325c356c43b0d51 |
|
18-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
Marked all non-trivial buffer modifications with @UNSAFE tag. Several
cleanups and a couple of minor bugfixes.
--HG--
branch : HEAD |
84df7eb79bda7af2f95da1d7c93634e56e28b831 |
|
17-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
comment update
--HG--
branch : HEAD |
def516ea503a60f20d510c14d5070b7ff5bbddf4 |
|
08-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
Added buffer API. Point is to hide all buffer writing behind this API which
verifies that nothing overflows. Much better than doing the same checks all
around the code, even if it is slightly slower.
Buffer reading is still mostly done directly, that isn't such a big security
risk and I can't think of a reasonable API for it anyway.
--HG--
branch : HEAD |