summaryrefslogtreecommitdiff
path: root/fc-cat/fc-cat.c
diff options
context:
space:
mode:
authorPatrick Lam <plam@MIT.EDU>2005-11-18 20:32:30 +0000
committerPatrick Lam <plam@MIT.EDU>2005-11-18 20:32:30 +0000
commit8f2a807810c006e771c0f7429ba218a1ffb1e6de (patch)
tree7f267ee63b0c027f05e488dbf9dd30cc5049ab55 /fc-cat/fc-cat.c
parent82912b062b1bb902db54e5b79f4a2d6a33ccd8a0 (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/fc-cat.c')
-rw-r--r--fc-cat/fc-cat.c3
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]);