~ubuntu-branches/ubuntu/raring/flac/raring

« back to all changes in this revision

Viewing changes to src/plugin_common/charset.c

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-12-06 16:57:20 UTC
  • mto: (8.1.1 lenny)
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: james.westby@ubuntu.com-20071206165720-4przr8grn6ha3e3a
Tags: upstream-1.2.1
ImportĀ upstreamĀ versionĀ 1.2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
        /* Due to a GLIBC bug, round outbuf_size up to a multiple of 4 */
84
84
        /* + 1 for nul in case len == 1 */
85
85
        outsize = ((length + 3) & ~3) + 1;
 
86
        if(outsize < length) /* overflow check */
 
87
                return NULL;
86
88
        out = (char*)malloc(outsize);
87
89
        outleft = outsize - 1;
88
90
        outptr = out;
95
97
                {
96
98
                        case E2BIG:
97
99
                                used = outptr - out;
 
100
                                if((outsize - 1) * 2 + 1 <= outsize) { /* overflow check */
 
101
                                        free(out);
 
102
                                        return NULL;
 
103
                                }
98
104
                                outsize = (outsize - 1) * 2 + 1;
99
105
                                out = realloc(out, outsize);
100
106
                                outptr = out + used;