Add NULL check
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 2 Jan 2013 02:10:18 +0000 (20:10 -0600)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 2 Jan 2013 02:19:57 +0000 (20:19 -0600)
src/fcformat.c

index a4c72ae..a8a1ad1 100644 (file)
@@ -1195,6 +1195,9 @@ FcPatternFormat (FcPattern *pat,
     FcChar8         buf_static[8192 - 1024];
     FcBool          ret;
 
+    if (!pat)
+       return NULL;
+
     FcStrBufInit (&buf, buf_static, sizeof (buf_static));
 
     ret = FcPatternFormatToBuf (pat, format, &buf);