changeset 3844:93959452e17e HEAD

try_alloc: Handle mail_get_physical_size() failures.
author Timo Sirainen <tss@iki.fi>
date Mon, 09 Jan 2006 10:05:24 +0200
parents 37b54ccbb961
children 18a786df5815
files src/plugins/quota/quota-dict.c src/plugins/quota/quota-dirsize.c
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/quota/quota-dict.c	Mon Jan 09 00:47:31 2006 +0200
+++ b/src/plugins/quota/quota-dict.c	Mon Jan 09 10:05:24 2006 +0200
@@ -231,6 +231,9 @@
 	uoff_t size;
 
 	size = mail_get_physical_size(mail);
+	if (size == (uoff_t)-1)
+		return -1;
+
 	*too_large_r = size > ctx->storage_limit;
 
 	if (ctx->storage_current + ctx->bytes_diff + size > ctx->storage_limit)
--- a/src/plugins/quota/quota-dirsize.c	Mon Jan 09 00:47:31 2006 +0200
+++ b/src/plugins/quota/quota-dirsize.c	Mon Jan 09 10:05:24 2006 +0200
@@ -269,6 +269,9 @@
 		return -1;
 
 	size = mail_get_physical_size(mail);
+	if (size == (uoff_t)-1)
+		return -1;
+
 	*too_large_r = size > ctx->storage_limit;
 
 	if (ctx->storage_current + ctx->bytes_diff + size > ctx->storage_limit)