~ubuntu-branches/ubuntu/karmic/pango1.0/karmic-security

« back to all changes in this revision

Viewing changes to pango/pango-markup.c

Tags: upstream-1.19.2
ImportĀ upstreamĀ versionĀ 1.19.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1079
1079
    {
1080
1080
      if (g_ascii_isdigit (*size))
1081
1081
        {
1082
 
          char *end = NULL;
1083
 
          gulong n;
1084
 
 
1085
 
          n = strtoul (size, &end, 10);
1086
 
 
1087
 
          if (*end != '\0' || n < 0 || n > 1000000)
 
1082
          const char *end;
 
1083
          gint n;
 
1084
 
 
1085
/* cap size from the top at an arbitrary 2048 */
 
1086
#define MAX_SIZE (2048 * PANGO_SCALE)
 
1087
 
 
1088
          if ((end = size, !pango_scan_int (&end, &n)) || *end != '\0' || n < 0 || n > MAX_SIZE)
1088
1089
            {
1089
1090
              g_set_error (error,
1090
1091
                           G_MARKUP_ERROR,
1091
1092
                           G_MARKUP_ERROR_INVALID_CONTENT,
1092
 
                           _("Value of 'size' attribute on <span> tag on line %d"
1093
 
                             "could not be parsed; should be an integer, or a "
 
1093
                           _("Value of 'size' attribute on <span> tag on line %d "
 
1094
                             "could not be parsed; should be an integer less than %d, or a "
1094
1095
                             "string such as 'small', not '%s'"),
1095
 
                           line_number, size);
 
1096
                           line_number, MAX_SIZE+1, size);
1096
1097
              goto error;
1097
1098
            }
1098
1099
 
1123
1124
          g_set_error (error,
1124
1125
                       G_MARKUP_ERROR,
1125
1126
                       G_MARKUP_ERROR_INVALID_CONTENT,
1126
 
                       _("Value of 'size' attribute on <span> tag on line %d"
 
1127
                       _("Value of 'size' attribute on <span> tag on line %d "
1127
1128
                         "could not be parsed; should be an integer, or a "
1128
1129
                         "string such as 'small', not '%s'"),
1129
1130
                       line_number, size);