Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at maildir-save.c:94

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

maildir_file_move

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/maildir/maildir-save.c)expand/collapse
Show more  
 67  static int maildir_file_move(struct maildir_save_context *ctx,
 68                               const char *tmpname, const char *destname,
 69                               bool newdir)
 70  {
 71          struct mail_storage *storage = &ctx->mbox->storage->storage;
 72          const char *tmp_path, *new_path;
 73          int ret;
 74   
 75          /* if we have flags, we'll move it to cur/ directly, because files in 
 76             new/ directory can't have flags. alternative would be to write it
 77             in new/ and set the flags dirty in index file, but in that case
 78             external MUAs would see wrong flags. */
 79[+]         tmp_path = t_strconcat(ctx->tmpdir, "/", tmpname, NULL);
 80          new_path = newdir ?
 81                  t_strconcat(ctx->newdir, "/", destname, NULL) :
 82                  t_strconcat(ctx->curdir, "/", destname, NULL);
 83   
 84          /* maildir spec says we should use link() + unlink() here. however 
 85             since our filename is guaranteed to be unique, rename() works just
 86             as well, except faster. even if the filename wasn't unique, the 
 87             problem could still happen if the file was already moved from
 88             new/ to cur/, so link() doesn't really provide any safety anyway.
 89   
 90             Besides the small temporary performance benefits, this rename() is 
 91             almost required with OSX's HFS+ filesystem, since it implements 
 92             hard links in a pretty ugly way, which makes the performance crawl 
 93             when a lot of hard links are used. */
 94          if (rename(tmp_path, new_path) == 0)
Show more  




Change Warning 7348.24841 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: