svn commit: r228553 - head/contrib/file

Dimitry Andric dim at FreeBSD.org
Thu Dec 15 23:28:17 UTC 2011


Author: dim
Date: Thu Dec 15 23:28:17 2011
New Revision: 228553
URL: http://svn.freebsd.org/changeset/base/228553

Log:
  In contrib/file/softmagic.c, fix a potential format string security
  problem.  (This fix has already been applied upstream, but we do not
  have the latest version of file in the tree at the moment.)
  
  MFC after:	1 week

Modified:
  head/contrib/file/softmagic.c

Modified: head/contrib/file/softmagic.c
==============================================================================
--- head/contrib/file/softmagic.c	Thu Dec 15 23:22:24 2011	(r228552)
+++ head/contrib/file/softmagic.c	Thu Dec 15 23:28:17 2011	(r228553)
@@ -1582,7 +1582,7 @@ mget(struct magic_set *ms, const unsigne
 
 	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;


More information about the svn-src-all mailing list