cc2b3aefaa55c44ae7bbe2ee74678ffcef016d91 |
|
21-Feb-2018 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
lib: Fix buffer code to satisfy static analyzers |
bcb4e51a409d94ae670de96afb8483a4f7855294 |
|
01-Jan-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
Updated copyright notices to include the year 2018. |
19557f192d37cd54a1a090a8a26d9d47265e4413 |
|
01-Nov-2017 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
global: Fix spelling mistakes in comments
Original work by @andreasschulze and @jsoref |
1a6ff0beebf0ab0c71081eaff1d5d7fd26015a94 |
|
19-Sep-2017 |
Josef 'Jeff' Sipek <jeff.sipek@dovecot.fi> |
lib: buffer_free(NULL) should be a no-op |
2454dfa32c93c20a8522c6ed42fe057baaac9f9a |
|
01-Jan-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
Updated copyright notices to include the year 2017. |
efe78d3ba24fc866af1c79b9223dc0809ba26cad |
|
24-Dec-2016 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
global: Replaced all instances of memset(p, 0, sizeof(*p)) with the new i_zero() macro.
Used the following script:
C_FILES=`git ls-files *.c`
H_FILES=`git ls-files *.h`
for F in "$C_FILES $H_FILES"; do
echo "$F"
perl -p -i -e 's/safe_memset\(&\(?([^,]*)\)?,\s*0,\s*sizeof\(\g1\)\)/i_zero_safe(&$1)/g' $F
perl -p -i -e 's/safe_memset\(([^,]*),\s*0,\s*sizeof\(\*\g1\)\)/i_zero_safe($1)/g' $F
perl -p -i -e 's/memset\(&\(?([^,]*)\)?,\s*0,\s*sizeof\(\g1\)\)/i_zero(&$1)/g' $F
perl -p -i -e 's/memset\(([^,]*),\s*0,\s*sizeof\(\*\g1\)\)/i_zero($1)/g' $F
done |
6d404348751c19ac37cfb42375abdd3c5f298e30 |
|
24-Nov-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: Code cleanup - avoid passing NULL to functions with non-null parameter |
e07b8f034b4c214e94aa5eb93d96ccbe60094b4b |
|
02-Nov-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
lib: Add buffer truncate |
0dffa25d211be541ee3c953b23566a1a990789df |
|
06-Jun-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: unsigned int:1 -> bool:1
perl -i -pe 's/unsigned int ([^,:;]+):1;/bool $1:1;/' **/*.[ch] |
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. |
09539f3db2f1b3e24f40844d8456b06d318d0fe7 |
|
29-Apr-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: buffer_create_dynamic() now adds +1 to init_size |
50ae8852cb28b11b9589a4ed5f2b54b10b1ab591 |
|
28-Apr-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Use p_malloc() explicitly in first buffer_alloc()
Although there is now code in p_realloc() that it should be just as
efficient, this makes profiling somewhat nicer since it can better
distinguish between actual reallocs and initial allocs. |
02c335c23bf5fa225a467c19f2c063fb0dc7b8c3 |
|
12-Jan-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: freshen copyright
git ls-files | xargs perl -p -i -e 's/(\d+)-201[0-5]/$1-2016/g;s/ (201[0-5]) Dovecot/ $1-2016 Dovecot/' |
e915ba86f157549b7d127f92312bc487b249df7e |
|
16-May-2015 |
Timo Sirainen <tss@iki.fi> |
lib: Added buffer_get_writable_size() |
0248b1c21bed383128c0d20ff11325a2f59d0410 |
|
18-Mar-2015 |
Phil Carmody <phil@dovecot.fi> |
lib: buffer - paranoid compile-time check for struct sizes
At the moment, nothing guarantees that the public struct is big
enough to contain the private struct.
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
7cb128dc4cae2a03a742f63ba7afee23c78e3af0 |
|
05-Jan-2015 |
Phil Carmody <phil@dovecot.fi> |
global: freshen copyright
Robomatically:
git ls-files | xargs perl -p -i -e 's/(\d+)-201[0-4]/$1-2015/g;s/ (201[0-4]) Dovecot/ $1-2015 Dovecot/'
Happy 2015 everyone!
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
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> |
a8c5a86d183db25a57bf193c06b41e092ec2e151 |
|
04-Feb-2014 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2014. |
5a580c3a38ced62d4bcc95b8ac7c4f2935b5d294 |
|
02-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
Oops :) Update copyrights to 2013 without breaking all .c files. |
cca4ba2a504d70a9fe9fee37f8433997359de52c |
|
02-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2013. |
8e4a702a1f96f118976da6eb9ece344df625eabb |
|
15-Jan-2013 |
Timo Sirainen <tss@iki.fi> |
buffer: Always keep +1 byte available for str_c()'s NUL. |
bfdef55e14ade87589bd10a6a1dafce53427ecf4 |
|
08-Jan-2013 |
Timo Sirainen <tss@iki.fi> |
DEBUG: buffer_verify_pool() crashed with empty buffer. |
6e37fcb7feb9a333e4c8c80d813fadfa2c6f0dac |
|
08-Jan-2013 |
Timo Sirainen <tss@iki.fi> |
DEBUG: buffer_verify_pool() crashed with static sized buffers. |
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. |
49d9165e32509d6fd8fe57f65a52d41343558e9a |
|
06-Sep-2012 |
Timo Sirainen <tss@iki.fi> |
buffer_create_data(): Clear the memory area immediately. |
5f5870385cff47efd2f58e7892f251cf13761528 |
|
12-Feb-2012 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2012. |
2e37d45867d081db150ab78dad303b9077aea24f |
|
04-Mar-2011 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2011. |
183bea41fa640dc8117f3eb45ff935cd81377a84 |
|
04-Mar-2011 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2011. |
96bd662dd0b11b4be42ebfa762f7ca328f37074a |
|
23-Aug-2010 |
Timo Sirainen <tss@iki.fi> |
liblib: Don't segfault if write is attempted beyond non-dynamic buffer's bounds. |
952f5f308ab79cd46ccd79b09db3215b4237d7d4 |
|
18-Jun-2010 |
Timo Sirainen <tss@iki.fi> |
DEBUG: Removed buffer's tests against overflows. It slows down too much.
--HG--
branch : HEAD |
05a0f878264b9853d07f229ffff1bc21355157be |
|
29-Apr-2010 |
Timo Sirainen <tss@iki.fi> |
DEBUG: Try to catch stale pointer dereferences to buffers after they've grown.
In normal use some such bugs may not be noticed easily, because the buffer's
memory allocation size is large enough that when adding another element the
pointer doesn't change.
--HG--
branch : HEAD |
e59faf65ce864fe95dc00f5d52b8323cdbd0608a |
|
25-Jan-2010 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2010.
--HG--
branch : HEAD |
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 |
b72b92d12bde9ca5f325a232babd74c6babef42f |
|
19-Mar-2009 |
Timo Sirainen <tss@iki.fi> |
Added more asserts.
--HG--
branch : HEAD |
45312f52ff3a3d4c137447be4c7556500c2f8bf2 |
|
06-Jan-2009 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2009.
--HG--
branch : HEAD |
68a4946b12583b88fa802e52ebee45cd96056772 |
|
20-Jun-2008 |
Timo Sirainen <tss@iki.fi> |
Added more consts, ATTR_CONSTs and ATTR_PUREs.
--HG--
branch : HEAD |
85ec23485fd5d85f0c8b69d087e9643109cfcea2 |
|
29-Feb-2008 |
Timo Sirainen <tss@iki.fi> |
buffer_reset(buf) and buffer_set_used_size(buf, 0) now do the same thing.
--HG--
branch : HEAD |
f874c9c2a43220d600b90456696246bf77981cd1 |
|
29-Feb-2008 |
Timo Sirainen <tss@iki.fi> |
buffer_reset(buf) and buffer_set_used_size(buf, 0) now do the same thing.
--HG--
branch : HEAD |
76b43e4417bab52e913da39b5f5bc2a130d3f149 |
|
01-Jan-2008 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2008.
--HG--
branch : HEAD |
c9bf63e9094761767a63ac6b189bcf60bcffdc44 |
|
17-Nov-2007 |
Timo Sirainen <tss@iki.fi> |
Use likely() and unlikely() macros to make commonly checked error handling
paths unlikely.
--HG--
branch : HEAD |
89a126810703c666309310d0f3189e9834d70b5b |
|
16-Sep-2007 |
Timo Sirainen <tss@iki.fi> |
Replaced my Copyright notices. The year range always ends with 2007 now.
My name was replaced with "Dovecot authors". In many cases I didn't really
even own the copyright, so this is more correct.
--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 |
1345157bfafcc329b237e55a35db8c2ad368a42a |
|
11-Jun-2007 |
Timo Sirainen <tss@iki.fi> |
Added buffer_get_pool()
--HG--
branch : HEAD |
4940e43005d04208fe957c8e5a359f9a53a23d1f |
|
18-Jan-2007 |
Timo Sirainen <tss@iki.fi> |
cleanup
--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 |
8d6cb44a0161d88743756733f83c4fb278485987 |
|
14-Feb-2006 |
Timo Sirainen <tss@iki.fi> |
While casting const pointers to something else, the const was often
unneededly dropped out in the middle of casts.
--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 |
02af13e6a41b9c3e6ad1e0b692b5b9741142c221 |
|
02-Apr-2005 |
Timo Sirainen <tss@iki.fi> |
Added buffer_cmp().
--HG--
branch : HEAD |
3bbe99d30871f49610aac0417ee5951d1e740b98 |
|
27-Mar-2005 |
Timo Sirainen <tss@iki.fi> |
Added pool_get_exp_grown_size(). Use it for buffers, istreams and ostreams
when buffer needs to grow. Optimizes memory usage a bit.
--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 |
b3286cc6a70ab6b4c53301aa075b16898b80c880 |
|
07-Nov-2004 |
Timo Sirainen <tss@iki.fi> |
Print pool name for "buffer full" errors.
--HG--
branch : HEAD |
e9219523bf8c03a1230a3a2710a2a291dc3a82a8 |
|
24-Oct-2004 |
Timo Sirainen <tss@iki.fi> |
buffer_insert() and buffer_insert_zero() didn't work correctly when it used
to append data.
--HG--
branch : HEAD |
06eee07a834e38c2a95603016f9405eb7ac5857d |
|
21-Oct-2004 |
Timo Sirainen <tss@iki.fi> |
Don't return values from void functions.
--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 |
c64f59429b74e25d50a202895fee863d032ae920 |
|
08-Oct-2004 |
Timo Sirainen <tss@iki.fi> |
buffer_insert* were broken
--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 |
9894ca11d0ddbdc968f1eb5675c1eefadc91d031 |
|
05-Sep-2004 |
Timo Sirainen <tss@iki.fi> |
buffer_reset() was broken..
--HG--
branch : HEAD |
40f114f2e12605483b21e7cf048b7c9bd9568148 |
|
18-Aug-2004 |
Timo Sirainen <tss@iki.fi> |
Added buffer_reset()
--HG--
branch : HEAD |
b406127781a4237845301c02e81fac8bf1c11612 |
|
31-Jul-2004 |
Timo Sirainen <tss@iki.fi> |
buffer_append() fix
--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 |
2ca64e9cb20ca517a5a0d4ba3b73dccb2a0dd973 |
|
07-Sep-2003 |
Timo Sirainen <tss@iki.fi> |
minor optimizations
--HG--
branch : HEAD |
5e0ce63bb65db34d7f48b34bbb5545fa791781c4 |
|
26-Aug-2003 |
Timo Sirainen <tss@iki.fi> |
Removed most of the license comments from src/lib/*.c. It's just fine to
keep them in a single COPYING.MIT file. Changed a few other comments as well.
--HG--
branch : HEAD |
5ae037e8a898c331708ca732af55db030991a989 |
|
18-Aug-2003 |
Timo Sirainen <tss@iki.fi> |
Inserting to end of buffer or past it didn't work
--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 |
01af88dfbb7a022ddb3ab9fb4159f2a4a204ead3 |
|
10-Jan-2003 |
Timo Sirainen <tss@iki.fi> |
Added old_size parameter to p_realloc() - we rarely need it and this way
each allocation takes 8 bytes less memory.
--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 |
9edba36ef9b2679b0585c345074b1f1d482bfd20 |
|
22-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
Several fixes. I think it's beginning to look safe.
--HG--
branch : HEAD |
bad5981f287ff1e4094428e27178062548215a93 |
|
21-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
whops, reverted unwanted changes
--HG--
branch : HEAD |
156a7c9057782ea8d805c4223082e1dd6041ef21 |
|
21-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
Last update broke used size.
--HG--
branch : HEAD |
fc7b32b6a2a65d604c8070b9b1a204f25c90b391 |
|
21-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
Fixed several bugs, added a small testsuite. Still requires careful auditing.
--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 |
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 |