~ubuntu-branches/ubuntu/natty/clamav/natty-security

« back to all changes in this revision

Viewing changes to libclamav/pdf.c

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2011-02-19 09:51:33 UTC
  • mfrom: (0.35.19 sid)
  • Revision ID: james.westby@ubuntu.com-20110219095133-sde2dyj8a6bjbkdh
Tags: 0.97+dfsg-0ubuntu1
* Merge from debian unstable (0ubuntu1 because the Debian upload was
  inadvertently left marked UNRELEASED).  Remaining changes:
  - Drop initial signature definitions from clamav-base
  - Drop build-dep on electric-fence (in Universe)
  - Add apparmor profiles for clamd and freshclam along with maintainer
    script changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
    if ((q2 = cli_memstr(start, bytesleft, "stream", 6))) {
115
115
        q2 += 6;
116
116
        bytesleft -= q2 - start;
117
 
        if (bytesleft < 1)
 
117
        if (bytesleft < 0)
118
118
            return 0;
119
119
        if (bytesleft >= 2 && q2[0] == '\xd' && q2[1] == '\xa')
120
120
            q2 += 2;
122
122
            q2++;
123
123
        *stream = q2 - start;
124
124
        bytesleft2 -= q2 - start;
125
 
        if (bytesleft2 < 0)
 
125
        if (bytesleft2 <= 0)
126
126
            return 0;
127
127
        q = q2;
128
128
        q2 = cli_memstr(q, bytesleft2, "endstream", 9);
1761
1761
            continue;
1762
1762
        if (buf[i] == '>')
1763
1763
            break;
1764
 
        if (cli_hex2str_to(buf+i, output+j++, 2) == -1) {
 
1764
        if (cli_hex2str_to(buf+i, output+j, 2) == -1) {
1765
1765
            if (len - i < 4)
1766
1766
                continue;
1767
1767
            return -1;
1768
1768
        }
 
1769
        j++;
1769
1770
        i++;
1770
1771
    }
1771
1772
    return j;
1831
1832
 
1832
1833
                                if(quintet > 1)
1833
1834
                                        sum += (0xFFFFFF >> ((quintet - 2) * 8));
1834
 
                                ret += quintet;
 
1835
                                ret += quintet-1;
1835
1836
                                for(i = 0; i < quintet - 1; i++)
1836
1837
                                        *output++ = (unsigned char)((sum >> (24 - 8 * i)) & 0xFF);
1837
1838
                        }