1. 22 4月, 2015 1 次提交
  2. 12 12月, 2013 1 次提交
  3. 09 4月, 2013 1 次提交
    • R
      fix out-of-bounds access in UTF-8 decoding · 8f06ab0e
      Rich Felker 提交于
      SA and SB are used as the lowest and highest valid starter bytes, but
      the value of SB was one-past the last valid starter. this caused
      access past the end of the state table when the illegal byte '\xf5'
      was encountered in a starter position. the error did not show up in
      full-character decoding tests, since the bogus state read from just
      past the table was unlikely to admit any continuation bytes as valid,
      but would have shown up had we tested feeding '\xf5' to the
      byte-at-a-time decoding in mbrtowc: it would cause the funtion to
      wrongly return -2 rather than -1.
      
      I may eventually go back and remove all references to SA and SB,
      replacing them with the values; this would make the code more
      transparent, I think. the original motivation for using macros was to
      allow misguided users of the code to redefine them for the purpose of
      enlarging the set of accepted sequences past the end of Unicode...
      8f06ab0e
  4. 24 2月, 2012 1 次提交
    • R
      cleanup and work around visibility bug in gcc 3 that affects x86_64 · bae2e52b
      Rich Felker 提交于
      in gcc 3, the visibility attribute must be placed on both the
      declaration and on the definition. if it's omitted from the
      definition, the compiler fails to emit the ".hidden" directive in the
      assembly, and the linker will either generate textrels (if supported,
      such as on i386) or refuse to link (on targets where certain types of
      textrels are forbidden or impossible without further assumptions about
      memory layout, such as on x86_64).
      
      this patch also unifies the decision about when to use visibility into
      libc.h and makes the visibility in the utf-8 state machine tables
      based on libc.h rather than a duplicate test.
      bae2e52b
  5. 27 2月, 2011 1 次提交
    • R
      cleanup utf-8 multibyte code, use visibility if possible · 015d33c5
      Rich Felker 提交于
      this code was written independently of musl, with support for a the
      backwards, nonstandard "31-bit unicode" some libraries/apps might
      want. unfortunately the extra code (inside #ifdef) makes the source
      harder to read and makes code that should be simple look complex, so
      i'm removing it. anyone who wants to use the old code can find it in
      the history or from elsewhere.
      
      also, change the visibility of the __fsmu8 state machine table to
      hidden, if supported. this should improve performance slightly in
      shared-library builds.
      015d33c5
  6. 14 2月, 2011 1 次提交
  7. 12 2月, 2011 1 次提交