[BACK]Return to signify.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / signify

Diff for /src/usr.bin/signify/signify.c between version 1.72 and 1.73

version 1.72, 2014/04/22 21:24:20 version 1.73, 2014/05/06 23:17:13
Line 175 
Line 175 
         struct stat sb;          struct stat sb;
         ssize_t x, space;          ssize_t x, space;
         int fd;          int fd;
           const unsigned long long maxmsgsize = 1UL << 30;
   
         fd = xopen(filename, O_RDONLY | O_NOFOLLOW, 0);          fd = xopen(filename, O_RDONLY | O_NOFOLLOW, 0);
         if (fstat(fd, &sb) == 0 && S_ISREG(sb.st_mode)) {          if (fstat(fd, &sb) == 0 && S_ISREG(sb.st_mode)) {
                 if (sb.st_size > (1UL << 30))                  if (sb.st_size > maxmsgsize)
                         errx(1, "msg too large in %s", filename);                          errx(1, "msg too large in %s", filename);
                 space = sb.st_size + 1;                  space = sb.st_size + 1;
         } else {          } else {
Line 188 
Line 189 
         msg = xmalloc(space + 1);          msg = xmalloc(space + 1);
         while (1) {          while (1) {
                 if (space == 0) {                  if (space == 0) {
                         if (msglen * 2 > (1UL << 30))                          if (msglen * 2 > maxmsgsize)
                                 errx(1, "msg too large in %s", filename);                                  errx(1, "msg too large in %s", filename);
                         space = msglen;                          space = msglen;
                         if (!(msg = realloc(msg, msglen + space + 1)))                          if (!(msg = realloc(msg, msglen + space + 1)))

Legend:
Removed from v.1.72  
changed lines
  Added in v.1.73