Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at istream-raw-mbox.c:94

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

mbox_read_from_line

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/mbox/istream-raw-mbox.c)expand/collapse
Show more  
 50  static int mbox_read_from_line(struct raw_mbox_istream *rstream)
 51  {
 52          const unsigned char *buf, *p;
 53          char *sender;
 54          time_t received_time;
 55          size_t pos, line_pos;
 56          ssize_t ret;
 57          unsigned int skip;
 58          int tz;
 59   
 60          buf = i_stream_get_data(rstream->istream.parent, &pos);
 61          i_assert(pos > 0);
 62   
 63          /* from_offset points to "\nFrom ", so unless we're at the beginning 
 64             of the file, skip the initial \n */
 65          if (rstream->from_offset == 0)
 66                  skip = 0;
 67          else {
 68                  skip = 1;
 69                  if (*buf == '\r')
 70                          skip++;
 71          }
 72   
 73          while ((p = memchr(buf+skip, '\n', pos-skip)) == NULL) {
 74                  ret = i_stream_read(rstream->istream.parent);
 75[+]                 buf = i_stream_get_data(rstream->istream.parent, &pos);
 76                  if (ret < 0) {
 77                          if (ret == -2) {
 78                                  /* From_-line is too long, but we should be
 79                                     able to parse what we have so far. */
 80                                  break;
 81                          }
 82                          /* EOF shouldn't happen */
 83                          rstream->istream.istream.eof =
 84                                  rstream->istream.parent->eof;
 85                          rstream->istream.istream.stream_errno =
 86                                  rstream->istream.parent->stream_errno;
 87                          return -1;
 88                  }
 89                  i_assert(pos > 0);
 90          }
 91          line_pos = p == NULL ? 0 : (size_t)(p - buf);
 92   
 93          /* beginning of mbox */
 94          if (memcmp(buf+skip, "From ", 5) != 0 ||
Show more  




Change Warning 7395.24532 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: