From: Christos Zoulas Date: Sun, 18 May 2008 23:20:40 +0000 (+0000) Subject: Avoid printing a bad pointer from Charles Longeau X-Git-Tag: FILE5_05~384 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3bbffe89bcd691d989c4b0015d54ed32b9f2cf9d;p=file Avoid printing a bad pointer from Charles Longeau --- diff --git a/src/apprentice.c b/src/apprentice.c index d35f148c..73935bcc 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -49,7 +49,7 @@ #include #ifndef lint -FILE_RCSID("@(#)$File: apprentice.c,v 1.135 2008/05/09 14:20:28 christos Exp $") +FILE_RCSID("@(#)$File: apprentice.c,v 1.136 2008/05/18 23:20:40 christos Exp $") #endif /* lint */ #define EATAB {while (isascii((unsigned char) *l) && \ @@ -1557,7 +1557,8 @@ check_format(struct magic_set *ms, struct magic *m) * string is not one character long */ file_magwarn(ms, "Printf format `%c' is not valid for type " - "`%s' in description `%s'", *ptr, + "`%s' in description `%s'", + ptr && *ptr ? *ptr : '?', file_names[m->type], m->desc); return -1; }