svn commit: r296499 - stable/9/usr.bin/mail

Pedro F. Giffuni pfg at FreeBSD.org
Tue Mar 8 14:39:01 UTC 2016


Author: pfg
Date: Tue Mar  8 14:39:00 2016
New Revision: 296499
URL: https://svnweb.freebsd.org/changeset/base/296499

Log:
  MFC r295675:
  Fix "naive" use of ftell(3).
  
  Secure coding practices, FIO19-C.

Modified:
  stable/9/usr.bin/mail/def.h
Directory Properties:
  stable/9/usr.bin/mail/   (props changed)

Modified: stable/9/usr.bin/mail/def.h
==============================================================================
--- stable/9/usr.bin/mail/def.h	Tue Mar  8 14:38:06 2016	(r296498)
+++ stable/9/usr.bin/mail/def.h	Tue Mar  8 14:39:00 2016	(r296499)
@@ -270,5 +270,5 @@ struct ignoretab {
  */
 #define trunc(stream) {							\
 	(void)fflush(stream); 						\
-	(void)ftruncate(fileno(stream), (off_t)ftell(stream));		\
+	(void)ftruncate(fileno(stream), ftello(stream));		\
 }


More information about the svn-src-stable-9 mailing list