~ubuntu-branches/ubuntu/vivid/musl/vivid

« back to all changes in this revision

Viewing changes to src/multibyte/mbtowc.c

  • Committer: Package Import Robot
  • Author(s): Kevin Bortis
  • Date: 2014-05-26 22:45:52 UTC
  • mfrom: (4.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20140526224552-qrtsct934q29xo0x
Tags: 1.1.4-1
* Import upstream version 1.1.4. (Closes: #754758)
* Fixes possible stack-based buffer overflow CVE-2014-3484 (Closes: #750815) 
* Includes fix for build regression on armhf and armel

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
{
13
13
        unsigned c;
14
14
        const unsigned char *s = (const void *)src;
 
15
        wchar_t dummy;
15
16
 
16
17
        if (!s) return 0;
17
18
        if (!n) goto ilseq;
18
 
        if (!wc) wc = (void *)&wc;
 
19
        if (!wc) wc = &dummy;
19
20
 
20
21
        if (*s < 0x80) return !!(*wc = *s);
21
22
        if (*s-SA > SB-SA) goto ilseq;