[dovecot-cvs]
dovecot/src/lib-storage/index/mbox mbox-sync.c, 1.151, 1.152
cras at dovecot.org
cras at dovecot.org
Fri Apr 22 23:58:21 EEST 2005
- Previous message: [dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync-parse.c,
1.40, 1.41 mbox-sync.c, 1.150, 1.151
- Next message: [dovecot-cvs] dovecot/src/lib-index mail-cache.c, 1.67,
1.68 mail-cache.h, 1.22, 1.23 mail-transaction-log.c, 1.92, 1.93
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv4928
Modified Files:
mbox-sync.c
Log Message:
Error message fix.
Index: mbox-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync.c,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -d -r1.151 -r1.152
--- mbox-sync.c 22 Apr 2005 20:55:36 -0000 1.151
+++ mbox-sync.c 22 Apr 2005 20:58:18 -0000 1.152
@@ -513,17 +513,25 @@
const char *str;
uint32_t uid_last;
unsigned int i;
+ int ret;
i_assert(sync_ctx->base_uid_last_offset != 0);
/* first check that the 10 bytes are there and they're exactly as
expected. just an extra safety check to make sure we never write
to wrong location in the mbox file. */
- if (pread_full(sync_ctx->write_fd, buf, sizeof(buf),
- sync_ctx->base_uid_last_offset) <= 0) {
+ ret = pread_full(sync_ctx->write_fd, buf, sizeof(buf),
+ sync_ctx->base_uid_last_offset);
+ if (ret < 0) {
mbox_set_syscall_error(sync_ctx->mbox, "pread_full()");
return -1;
}
+ if (ret == 0) {
+ mail_storage_set_critical(STORAGE(sync_ctx->mbox->storage),
+ "X-IMAPbase uid-last unexpectedly points outside "
+ "mbox file %s", sync_ctx->mbox->path);
+ return -1;
+ }
for (i = 0, uid_last = 0; i < sizeof(buf); i++) {
if (buf[i] < '0' || buf[i] > '9') {
- Previous message: [dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync-parse.c,
1.40, 1.41 mbox-sync.c, 1.150, 1.151
- Next message: [dovecot-cvs] dovecot/src/lib-index mail-cache.c, 1.67,
1.68 mail-cache.h, 1.22, 1.23 mail-transaction-log.c, 1.92, 1.93
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list