Text   |  XML   |  ReML   |   Visible Warnings:

Format String  at imap-quota-plugin.c:119

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

cmd_getquotaroot

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/plugins/imap-quota/imap-quota-plugin.c)expand/collapse
Show more  
 66  static bool cmd_getquotaroot(struct client_command_context *cmd)
 67  {
 68          struct client *client = cmd->client;
 69          struct mail_storage *storage;
 70          struct mail_namespace *ns;
 71          struct mailbox *box;
 72          struct quota_root_iter *iter;
 73          struct quota_root *root;
 74          const char *orig_mailbox, *mailbox, *name;
 75          string_t *str;
 76   
 77          /* <mailbox> */
 78          if (!client_read_string_args(cmd, 1, &mailbox))
 79                  return FALSE;
 80   
 81          orig_mailbox = mailbox;
 82          storage = client_find_storage(cmd, &mailbox);
 83          if (storage == NULL)
 84                  return TRUE;
 85   
 86          box = mailbox_open(&storage, mailbox, NULL, (MAILBOX_OPEN_READONLY |
 87                                                       MAILBOX_OPEN_FAST |
 88                                                       MAILBOX_OPEN_KEEP_RECENT));
 89          if (box == NULL) {
 90                  client_send_storage_error(cmd, storage);
 91                  return TRUE;
 92          }
 93   
 94          ns = mail_storage_get_namespace(storage);
 95          if (quota_set == NULL) {
 96                  mailbox_close(&box);
 97                  client_send_tagline(cmd, "OK No quota.");
 98                  return TRUE;
 99          }
 100          if (ns->owner != NULL && ns->owner != client->user &&
 101              !client->user->admin) {
 102                  mailbox_close(&box);
 103                  client_send_tagline(cmd, "NO Not showing other users' quota.");
 104                  return TRUE;
 105          }
 106   
 107          /* send QUOTAROOT reply */
 108          str = t_str_new(128);
 109          str_append(str, "* QUOTAROOT ");
 110          imap_quote_append_string(str, orig_mailbox, FALSE);
 111   
 112          iter = quota_root_iter_init(box);
 113          while ((root = quota_root_iter_next(iter)) != NULL) {
 114                  str_append_c(str, ' ');
 115                  name = imap_quota_root_get_name(client->user, ns->owner, root);
 116                  imap_quote_append_string(str, name, FALSE);
 117          }
 118          quota_root_iter_deinit(&iter);
 119          client_send_line(client, str_c(str));
 120   
 121          /* send QUOTA reply for each quotaroot */
 122          iter = quota_root_iter_init(box);
 123          while ((root = quota_root_iter_next(iter)) != NULL)
 124                  quota_send(cmd, ns->owner, root);
 125          quota_root_iter_deinit(&iter);
 126          mailbox_close(&box);
 127   
 128          client_send_tagline(cmd, "OK Getquotaroot completed.");
 129          return TRUE;
 130  }
Show more  




Change Warning 8193.26103 : Format String

Priority:
State:
Finding:
Owner:
Note: