1. 12 Jul, 2022 2 commits
  2. 08 Dec, 2021 2 commits
  3. 17 Nov, 2020 1 commit
  4. 16 Nov, 2020 1 commit
  5. 25 Aug, 2019 1 commit
  6. 09 Jun, 2019 1 commit
    • Tobias Stoeckmann's avatar
      ucs2any: Fix parser crash on 32 bit · c5d12b72
      Tobias Stoeckmann authored and Alan Coopersmith's avatar Alan Coopersmith committed
      
      
      It is possible to crash ucs2any or provoke successful return value even
      though the processing was not successful.
      
      The problem lies within a possible integer overflow when adding elements
      with a key which is too large.
      
      You can trigger the issue this way on a 32 bit system:
      
      $ cat > source.bdf << "EOF"
      STARTFONT source
      CHARS 1
      ENCODING 1073741823
      EOF
      $ ucs2any source.bdf
      Segmentation fault
      $ _
      
      Another possibility would be to add "ENCODING 1" right after the CHARS
      line. In that case, realloc will allocate 0 bytes afterwards which is a
      success but might return NULL, e.g. on Linux/glibc systems. Such a
      result value is handled as an error and errno is evaluated and returned,
      even though there was no error:
      
      $ cat > source.bdf << "EOF"
      STARTFONT source
      CHARS 1
      ENCODING 1
      ENCODING 1073741823
      EOF
      $ ucs2any source.bdf
      ucs2any: Success
      $ echo $?
      0
      $ _
      
      Signed-off-by: Tobias Stoeckmann's avatarTobias Stoeckmann <tobias@stoeckmann.org>
      Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      c5d12b72
  7. 08 Dec, 2018 1 commit
  8. 19 Nov, 2018 1 commit
  9. 26 Jan, 2017 3 commits
  10. 14 Mar, 2015 1 commit
  11. 26 Aug, 2014 1 commit
  12. 14 Dec, 2013 1 commit
  13. 16 Jan, 2013 2 commits
  14. 16 Dec, 2012 1 commit
    • Alan Coopersmith's avatar
      Fix a bunch of clang integer size conversion warnings in ucs2any · aba5a2f2
      Alan Coopersmith authored
      
      
      ucs2any.c:149:36: warning: implicit conversion changes signedness: 'int' to 'si
      ze_t' (aka 'unsigned long') [-Wsign-conversion]
              *dest = zrealloc(*dest, dest_size + source_size);
                      ~~~~~~~~        ~~~~~~~~~~^~~~~~~~~~~~~
      ucs2any.c:147:29: warning: implicit conversion loses integer precision: 'unsign
      ed long' to 'int' [-Wshorten-64-to-32]
                      dest_size = strlen(*dest) + 1;
                                ~ ~~~~~~~~~~~~~~^~~
      ucs2any.c:148:16: warning: implicit conversion loses integer precision: 'size_t
      ' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
              source_size = strlen(source);
                          ~ ^~~~~~~~~~~~~~
      ucs2any.c:159:8: warning: implicit conversion loses integer precision: 'int' to
       'char' [-Wconversion]
                      *t = toupper(*t);
                         ~ ^~~~~~~~~~~
      ucs2any.c:305:27: warning: implicit conversion loses integer precision: 'int' t
      o 'char' [-Wconversion]
                      (*buffer)[position++] = c;
                                            ~ ^
      ucs2any.c:465:21: warning: comparison of integers of different signs: 'size_t'
      (aka 'unsigned long') and 'int' [-Wsign-compare]
              if (strlen(string) <= l) return NULL;
                  ~~~~~~~~~~~~~~ ^  ~
      ucs2any.c:466:31: warning: implicit conversion changes signedness: 'int' to 'si
      ze_t' (aka 'unsigned long') [-Wsign-conversion]
              if (strncmp(string, pattern, l) != 0) return NULL;
                  ~~~~~~~                  ^
      ucs2any.c:463:10: warning: implicit conversion loses integer precision: 'size_t
      ' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
              int l = strlen(pattern);
                  ~   ^~~~~~~~~~~~~~~
      ucs2any.c:730:14: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                                      target = strtol(p+2, &endp, 16);
                                             ~ ^~~~~~~~~~~~~~~~~~~~~~
      ucs2any.c:738:11: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                                      ucs = strtol(p+2, &endp, 16);
                                          ~ ^~~~~~~~~~~~~~~~~~~~~~
      ucs2any.c:843:19: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                                              bbx.cwidth = w;
                                                         ~ ^
      ucs2any.c:844:20: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                                              bbx.cheight = h;
                                                          ~ ^
      ucs2any.c:845:18: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                                              bbx.cxoff = x;
                                                        ~ ^
      ucs2any.c:846:18: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                                              bbx.cyoff = y;
                                                        ~ ^
      ucs2any.c:850:7: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                                                      w, h, x, y, &bbx);
                                                      ^
      ucs2any.c:850:10: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                                                      w, h, x, y, &bbx);
                                                         ^
      ucs2any.c:850:13: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                                                      w, h, x, y, &bbx);
                                                            ^
      ucs2any.c:850:16: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                                                      w, h, x, y, &bbx);
                                                               ^
      
      Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      aba5a2f2
  15. 29 Feb, 2012 1 commit
  16. 24 Feb, 2012 1 commit
  17. 19 Nov, 2011 2 commits
  18. 26 Sep, 2011 1 commit
  19. 25 Sep, 2011 2 commits
  20. 04 May, 2011 1 commit
  21. 28 Apr, 2011 2 commits
  22. 08 Oct, 2010 3 commits
  23. 07 Oct, 2010 1 commit
  24. 05 Oct, 2010 3 commits
  25. 28 Aug, 2010 1 commit
  26. 20 Aug, 2010 1 commit
  27. 21 May, 2010 1 commit
  28. 28 Mar, 2010 1 commit