(sql_retrieve_quota): Allow for NULL columns
Showing
1 changed file
with
4 additions
and
2 deletions
... | @@ -216,6 +216,7 @@ sql_retrieve_quota (char *name, size_t *quota) | ... | @@ -216,6 +216,7 @@ sql_retrieve_quota (char *name, size_t *quota) |
216 | else | 216 | else |
217 | { | 217 | { |
218 | rc = RETR_OK; | 218 | rc = RETR_OK; |
219 | tmp = NULL; | ||
219 | status = mu_sql_get_column (conn, 0, 0, &tmp); | 220 | status = mu_sql_get_column (conn, 0, 0, &tmp); |
220 | if (status) | 221 | if (status) |
221 | { | 222 | { |
... | @@ -224,7 +225,7 @@ sql_retrieve_quota (char *name, size_t *quota) | ... | @@ -224,7 +225,7 @@ sql_retrieve_quota (char *name, size_t *quota) |
224 | mu_strerror (status)); | 225 | mu_strerror (status)); |
225 | rc = RETR_FAILURE; | 226 | rc = RETR_FAILURE; |
226 | } | 227 | } |
227 | else if (strcasecmp (tmp, "none") == 0) | 228 | else if (tmp == NULL || strcasecmp (tmp, "none") == 0) |
228 | rc = RETR_UNLIMITED; | 229 | rc = RETR_UNLIMITED; |
229 | else | 230 | else |
230 | { | 231 | { |
... | @@ -232,7 +233,8 @@ sql_retrieve_quota (char *name, size_t *quota) | ... | @@ -232,7 +233,8 @@ sql_retrieve_quota (char *name, size_t *quota) |
232 | 233 | ||
233 | if (get_size (tmp, quota, &p)) | 234 | if (get_size (tmp, quota, &p)) |
234 | { | 235 | { |
235 | mu_error (_("bogus mailbox quota for `%s' (near `%s')"), name, p); | 236 | mu_error (_("bogus mailbox quota for `%s' (near `%s')"), |
237 | name, p); | ||
236 | *quota = groupquota; | 238 | *quota = groupquota; |
237 | } | 239 | } |
238 | } | 240 | } | ... | ... |
-
Please register or sign in to post a comment