[dovecot-cvs] dovecot/src/lib-storage/index index-save.c,1.27,1.28
cras at procontrol.fi
cras at procontrol.fi
Tue Mar 4 20:51:04 EET 2003
- Previous message: [dovecot-cvs] dovecot/src/master auth-process.c,1.38,1.39 common.h,1.13,1.14 login-process.c,1.36,1.37 mail-process.c,1.10,1.11 main.c,1.40,1.41 master-login-interface.h,1.3,1.4
- Next message: [dovecot-cvs] dovecot/src/imap-login client-authenticate.c,1.4,1.5 client.c,1.7,1.8 client.h,1.3,1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/lib-storage/index
In directory danu:/tmp/cvs-serv28537/lib-storage/index
Modified Files:
index-save.c
Log Message:
Don't crash if something tries to write 0 bytes in headers while saving the
message. This happened sometimes with mbox.
Index: index-save.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-save.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- index-save.c 20 Feb 2003 19:51:44 -0000 1.27
+++ index-save.c 4 Mar 2003 18:51:02 -0000 1.28
@@ -27,7 +27,10 @@
{
size_t i, start;
- i_assert(size > 0 && size <= SSIZE_T_MAX);
+ i_assert(size <= SSIZE_T_MAX);
+
+ if (size == 0)
+ return 0;
start = 0;
for (i = 0; i < size; i++) {
@@ -58,7 +61,10 @@
{
size_t i, start;
- i_assert(size > 0 && size <= SSIZE_T_MAX);
+ i_assert(size <= SSIZE_T_MAX);
+
+ if (size == 0)
+ return 0;
start = 0;
for (i = 0; i < size; i++) {
@@ -162,7 +168,7 @@
failed = FALSE;
for (;;) {
data = i_stream_get_data(input, &size);
- if (!failed && size > 0) {
+ if (!failed) {
ret = write_func(output, data, size);
if (ret < 0) {
set_write_error(storage, output, path);
- Previous message: [dovecot-cvs] dovecot/src/master auth-process.c,1.38,1.39 common.h,1.13,1.14 login-process.c,1.36,1.37 mail-process.c,1.10,1.11 main.c,1.40,1.41 master-login-interface.h,1.3,1.4
- Next message: [dovecot-cvs] dovecot/src/imap-login client-authenticate.c,1.4,1.5 client.c,1.7,1.8 client.h,1.3,1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list