svn commit: r296498 - stable/10/usr.bin/mail

Pedro F. Giffuni pfg at FreeBSD.org
Tue Mar 8 14:38:08 UTC 2016


Author: pfg
Date: Tue Mar  8 14:38:06 2016
New Revision: 296498
URL: https://svnweb.freebsd.org/changeset/base/296498

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

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

Modified: stable/10/usr.bin/mail/def.h
==============================================================================
--- stable/10/usr.bin/mail/def.h	Tue Mar  8 11:04:08 2016	(r296497)
+++ stable/10/usr.bin/mail/def.h	Tue Mar  8 14:38:06 2016	(r296498)
@@ -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-10 mailing list