Commit Graph

20 Commits

Author SHA1 Message Date
Alan Coopersmith cb72901d0b Leave room for null terminators in arrays
Code currently returns a fatal error if it tries to add more entries
than the array has room for, but it wasn't checking to make sure
the final null terminator entry would fit.

Reported by parfait 1.3:
Error: Buffer overrun
   Buffer overflow (CWE 120): In array dereference of files[i] with index i
      Array size is 256 elements (of 4 bytes each), index >= 0 and index <= 256
        at line 250 of fc-glyphname/fc-glyphname.c in function 'main'.
Error: Buffer overrun
   Buffer overflow (CWE 120): In array dereference of entries[i] with index i
      Array size is 1024 elements (of 8 bytes each), index >= 0 and index <= 1024
        at line 298 of fc-lang/fc-lang.c in function 'main'.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-11-05 11:42:59 +09:00
Behdad Esfahbod bc62c40597 Really fix cross-compiling and building of tools this time 2013-01-02 20:09:05 -06:00
Behdad Esfahbod 5c0a4f2726 Minor 2013-01-02 02:27:57 -06:00
Behdad Esfahbod 5aaf466d38 Cleanup copyright notices to replace "Keith Packard" with "the author(s)" 2010-11-10 16:45:42 -05:00
Behdad Esfahbod 192927225c [fc-glyphname] Rename internal arrays to prefix with _fc_
Although they were static, I was still surprised that gdb was seeing
our variable "glyphs".  Not helpful.
2009-11-18 09:26:24 -05:00
Behdad Esfahbod 3074a73b41 Replace 'KEITH PACKARD' with 'THE AUTHOR(S)' in license text in all files 2009-03-13 17:59:28 -04:00
Behdad Esfahbod e690fbb20e Get rid of $Id$ tags 2009-02-13 16:53:57 -08:00
Keith Packard 96925b99c0 Eliminate relocations for glyph name table.
Glyph names (now used only for dingbats) were using many relocations,
causing startup latency plus per-process memory usage. Replace pointers with
table indices, shrinking table size and elimninating relocations.
2007-10-18 09:43:22 -07:00
Keith Packard fa741cd4ff rehash increment could be zero, causing rehash infinite loop.
Bump the rehash value by one so that it is always positive.
2007-03-12 10:30:51 -07:00
Keith Packard bc5e487f2a Pass directory information around in FcCache structure. Freeze charsets.
Instead of passing directory information around in separate variables,
collect it all in an FcCache structure. Numerous internal and tool
interfaces changed as a result of this.

Charsets are now pre-frozen before being serialized. This causes them to
share across multiple fonts in the same cache.
2006-09-01 01:15:14 -07:00
Patrick Lam 67ed0b7297 Include more stub definitions to make HP-UX's C compiler happy. 2006-04-10 22:08:35 +00:00
Patrick Lam 0d745819a9 Fix intel compiler warnings: make many variables static, eliminate
duplicate names, reduce variable scopes, unsigned/signed printf
    formatting.
reviewed by: plam
2006-04-06 04:33:11 +00:00
Patrick Lam ead55be0ed More stub definitions and remove FcFileIsDir from fc-cat. 2006-03-03 18:19:04 +00:00
Patrick Lam 21696e5bf0 Add consts to variables so as to move arrays into .rodata.
reviewed by: plam
2005-10-14 21:02:31 +00:00
Patrick Lam 67accef4d3 Fix more gcc4 warnings:
- Cast sizeof to int, to shut up signedness warnings in comparison.
- Add consts where appropriate.
reviewed by: Patrick Lam <plam@mit.edu>
2005-09-22 23:45:53 +00:00
Patrick Lam 8245771d5a Merge with HEAD and finish the GCC 4 cleanups (no more warnings!) 2005-09-11 02:16:09 +00:00
Keith Packard 46b51147d1 Change files from ISO-Latin-1 to UTF-8 2004-12-07 01:14:46 +00:00
Manish Singh de66e750a5 Cast strlen to int for printf, so we're 64-bit clean. 2004-02-22 02:21:37 +00:00
Carl Worth 34cd0514a2 Added new FcFini function for cleaning up all memory. Fixed a few memory
leaks. fc-list now calls FcFini, (and is now leak-free according to
    valgrind)
2003-08-15 19:45:20 +00:00
Keith Packard 721d496d78 Add fc-glyphname to compute hash tables for Adobe glyph name to UCS4
conversion functions
2003-05-04 22:50:17 +00:00