[dovecot-cvs] dovecot/src/plugins/quota quota-dict.c, 1.9.2.3,
1.9.2.4
cras at dovecot.org
cras at dovecot.org
Sat Jun 17 15:21:22 EEST 2006
Update of /var/lib/cvs/dovecot/src/plugins/quota
In directory talvi:/tmp/cvs-serv29064
Modified Files:
Tag: branch_1_0
quota-dict.c
Log Message:
Don't crash if dict_lookup() didn't return success.
Index: quota-dict.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/quota/quota-dict.c,v
retrieving revision 1.9.2.3
retrieving revision 1.9.2.4
diff -u -d -r1.9.2.3 -r1.9.2.4
--- quota-dict.c 16 Jun 2006 08:42:18 -0000 1.9.2.3
+++ quota-dict.c 17 Jun 2006 12:21:20 -0000 1.9.2.4
@@ -114,7 +114,7 @@
t_push();
ret = dict_lookup(root->dict, unsafe_data_stack_pool,
DICT_QUOTA_CURRENT_BYTES_PATH, &value);
- *value_r = value == NULL ? 0 : strtoull(value, NULL, 10) / 1024;
+ *value_r = ret <= 0 ? 0 : strtoull(value, NULL, 10) / 1024;
t_pop();
} else if (strcmp(name, QUOTA_NAME_MESSAGES) == 0) {
if (root->message_count_limit == (uint64_t)-1)
@@ -124,7 +124,7 @@
t_push();
ret = dict_lookup(root->dict, unsafe_data_stack_pool,
DICT_QUOTA_CURRENT_COUNT_PATH, &value);
- *value_r = value == NULL ? 0 : strtoull(value, NULL, 10);
+ *value_r = ret <= 0 ? 0 : strtoull(value, NULL, 10);
t_pop();
} else {
return 0;
More information about the dovecot-cvs
mailing list