Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Call  at sendfile-util.c:40

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

safe_sendfile

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/sendfile-util.c)expand/collapse
Show more  
 19  ssize_t safe_sendfile(int out_fd, int in_fd, uoff_t *offset, size_t count)
 20  {
 21          /* REMEBER: uoff_t and off_t may not be of same size. */
 22          off_t safe_offset;
 23          ssize_t ret;
 24   
 25          if (count == 0)
 26                  return 0;
 27   
 28          /* make sure given offset fits into off_t */
 29          if (sizeof(off_t) * CHAR_BIT == 32) {
 30                  /* 32bit off_t */
 31                  if (*offset >= 2147483647L) {
 32                          errno = EINVAL;
 33                          return -1;
 34                  }
 35                  if (count > 2147483647L - *offset)
 36                          count = 2147483647L - *offset;
 37          } else {
 38                  /* they're most likely the same size. if not, fix this
 39                     code later */
 40                  i_assert(sizeof(off_t) == sizeof(uoff_t));
 41   
 42                  if (*offset >= OFF_T_MAX) {
 43                          errno = EINVAL;
 44                          return -1;
 45                  }
 46                  if (count > OFF_T_MAX - *offset)
 47                          count = OFF_T_MAX - *offset;
 48          }
 49   
 50          safe_offset = (off_t)*offset;
 51          ret = sendfile(out_fd, in_fd, &safe_offset, count);
 52          /* ret=0 : trying to read past EOF, errno = EPIPE : remote is gone */
 53          *offset = (uoff_t)safe_offset;
 54          return ret;
 55  }
Show more  




Change Warning 7121.24399 : Unreachable Call

Priority:
State:
Finding:
Owner:
Note: