Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Mar 2016 14:39:00 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r296499 - stable/9/usr.bin/mail
Message-ID:  <201603081439.u28Ed0Cr096400@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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));		\
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603081439.u28Ed0Cr096400>