~ubuntu-branches/ubuntu/trusty/xulrunner/trusty

« back to all changes in this revision

Viewing changes to mailnews/mime/src/mimetric.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Devid Antonio Filoni
  • Date: 2008-08-25 13:04:18 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20080825130418-ck1i2ms384tzb9m0
Tags: 1.8.1.16+nobinonly-0ubuntu1
* New upstream release (taken from upstream CVS), LP: #254618.
* Fix MFSA 2008-35, MFSA 2008-34, MFSA 2008-33, MFSA 2008-32, MFSA 2008-31,
  MFSA 2008-30, MFSA 2008-29, MFSA 2008-28, MFSA 2008-27, MFSA 2008-25,
  MFSA 2008-24, MFSA 2008-23, MFSA 2008-22, MFSA 2008-21, MFSA 2008-26 also
  known as CVE-2008-2933, CVE-2008-2785, CVE-2008-2811, CVE-2008-2810,
  CVE-2008-2809, CVE-2008-2808, CVE-2008-2807, CVE-2008-2806, CVE-2008-2805,
  CVE-2008-2803, CVE-2008-2802, CVE-2008-2801, CVE-2008-2800, CVE-2008-2798.
* Drop 89_bz419350_attachment_306066 patch, merged upstream.
* Bump Standards-Version to 3.8.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
                if (!nsCRT::IsAsciiSpace (*this_start)) break;
122
122
          if (this_start >= line + length) /* blank line */
123
123
                {
124
 
                  PL_strcpy (*obufferP, "<BR>");
 
124
                  PL_strncpyz (*obufferP, "<BR>", *obuffer_sizeP);
125
125
                  return output_fn (*obufferP, strlen(*obufferP), closure);
126
126
                }
127
127
        }
128
128
 
 
129
  PRUint32 outlen = (PRUint32) *obuffer_sizeP;
129
130
  out = *obufferP;
130
131
  *out = 0;
131
132
 
133
134
  last_end = line;
134
135
  this_start = last_end;
135
136
  this_end = this_start;
 
137
  PRUint32 addedlen = 0;
136
138
  while (this_end < data_end)
137
139
        {
138
140
          /* Skip forward to next special character. */
162
164
                  memcpy (out, last_end, this_start - last_end);
163
165
                  out += this_start - last_end;
164
166
                  *out = 0;
 
167
                  outlen -= (this_start - last_end);
165
168
                }
166
169
 
167
170
          if (this_start >= data_end)
168
171
                break;
169
172
          else if (*this_start == '&')
170
173
                {
171
 
                  PL_strcpy (out, "&amp;"); out += strlen (out);
 
174
                  PL_strncpyz (out, "&amp;", outlen);
 
175
                  addedlen = strlen(out);
 
176
                  outlen -= addedlen;
 
177
                  out += addedlen;
172
178
                }
173
179
          else if (*this_start == '>')
174
180
                {
175
 
                  PL_strcpy (out, "&gt;"); out += strlen (out);
 
181
                  PL_strncpyz (out, "&gt;", outlen);
 
182
                  addedlen = strlen(out);
 
183
                  outlen -= addedlen;
 
184
                  out += addedlen;
176
185
                }
177
186
          else if (enriched_p &&
178
187
                           this_start < data_end + 1 &&
179
188
                           this_start[0] == '<' &&
180
189
                           this_start[1] == '<')
181
190
                {
182
 
                  PL_strcpy (out, "&lt;"); out += strlen (out);
 
191
                  PL_strncpyz (out, "&lt;", outlen);
 
192
                  addedlen = strlen(out);
 
193
                  outlen -= addedlen;
 
194
                  out += addedlen;
183
195
                }
184
196
          else if (this_start != this_end)
185
197
                {
313
325
 
314
326
                  if (this_start[1] == '/')
315
327
                        {
316
 
                          if (tag_close) PL_strcpy (out, tag_close);
317
 
                          out += strlen (out);
 
328
                          if (tag_close) PL_strncpyz (out, tag_close, outlen);
 
329
                          addedlen = strlen (out);
 
330
                          outlen -= addedlen;
 
331
                          out += addedlen;
318
332
                        }
319
333
                  else
320
334
                        {
321
 
                          if (tag_open) PL_strcpy (out, tag_open);
322
 
                          out += strlen (out);
 
335
                          if (tag_open) PL_strncpyz (out, tag_open, outlen);
 
336
                  addedlen = strlen (out);
 
337
                  outlen -= addedlen;
 
338
                          out += addedlen;
323
339
                        }
324
340
                }
325
341