diff options
author | Patrick Lam <plam@MIT.EDU> | 2005-11-18 20:32:30 +0000 |
---|---|---|
committer | Patrick Lam <plam@MIT.EDU> | 2005-11-18 20:32:30 +0000 |
commit | 8f2a807810c006e771c0f7429ba218a1ffb1e6de (patch) | |
tree | 7f267ee63b0c027f05e488dbf9dd30cc5049ab55 /fc-cat | |
parent | 82912b062b1bb902db54e5b79f4a2d6a33ccd8a0 (diff) |
Don't crash when fc-cat invoked with no arguments.
Fix invalid read access caused by premature free and GCC4 warnings in
libxml2 codepath.
reviewed by: plam
reviewed by: plam
Diffstat (limited to 'fc-cat')
-rw-r--r-- | fc-cat/fc-cat.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fc-cat/fc-cat.c b/fc-cat/fc-cat.c index 4f5b71d5..4436512a 100644 --- a/fc-cat/fc-cat.c +++ b/fc-cat/fc-cat.c @@ -325,6 +325,9 @@ main (int argc, char **argv) i = 1; #endif + if (i >= argc) + usage (argv[0]); + if (FcCacheFileRead (fs, dirs, dirname (strdup(argv[i])), argv[i])) FcCachePrintSet (fs, dirs, argv[i]); |