Skip to content

Commit

Permalink
Use '%s' format to print untrusted string.
Browse files Browse the repository at this point in the history
  • Loading branch information
rrthomas committed Sep 20, 2010
1 parent a52287d commit b05926f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/softmagic.c
Expand Up @@ -32,7 +32,7 @@
#include "file.h"

#ifndef lint
FILE_RCSID("@(#)$File: softmagic.c,v 1.139 2010/01/28 23:25:18 christos Exp $")
FILE_RCSID("@(#)$File: softmagic.c,v 1.140 2010/07/21 16:47:18 christos Exp $")
#endif /* lint */

#include "magic.h"
Expand Down Expand Up @@ -1585,7 +1585,7 @@ mget(struct magic_set *ms, const unsigned char *s,

case FILE_INDIRECT:
if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
file_printf(ms, m->desc) == -1)
file_printf(ms, "%s", m->desc) == -1)
return -1;
if (nbytes < offset)
return 0;
Expand Down

0 comments on commit b05926f

Please sign in to comment.